rtitions." (http://wias-berlin.de/software/index.jsp?id=TetGen&lang=1)
To continue with my wrapping career, TetRhino (or Tetrino) is a .NET wrapper for the well-known and pretty amazing TetGen mesh tetrahedralization program. It provides one new GH component for discretizing or remeshing objects using TetGen. Basic tetrahedralization functionality is exposed with a few different output types that can be controlled. At the moment, the only control for tetrahedra sizes is the minimum ratio, which is controlled by a slider. This is hardcoded to always be above 1.0-1.1, as it is very easy to generate a LOT of data (and crash)...
The libs are divided again into different modules to allow flexibility and fun with or without Rhino and GH, so have fun. All 4 libs should be placed in a folder (maybe called 'tetgen') in your GH libraries folder. Remember to unblock.
Once again, the libs are provided as-is, with no guarantee of support for now, as I use them internally and do not intend to develop this into a shiny, polished plug-in. If there is enough interest, I can tidy up the code-base and upload it somewhere if someone more savvy than me wants to play.
TetgenGH.gha - Grasshopper assembly which adds the 'Tetrahedralize' component to Mesh -> Triangulation.
TetgenRC.dll - RhinoCommon interface to the Tetgen wrapper.
TetgenSharp.dll - dotNET wrapper for Tetgen.
TetgenWrapper.dll - Actual wrapper for Tetgen.
Obviously, credit where credit is due for this excellent and tiny piece of software:
"The development of TetGen is executed at the Weierstrass Institute for Applied Analysis and Stochastics in the research group of Numerical Mathematics and Scientific Computing." See http://wias-berlin.de/software/index.jsp?id=TetGen&lang=1 for more details about TetGen.
To wrap up, some notes about the inputs:
These are the possible integer Flags (F) values and resultant outputs for the GH component:
0 - Output M yields a closed boundary mesh. Useful for simply remeshing your input mesh.
1 - Output M yields a list of tetra meshes.
2 - Output I yields a DataTree of tetra indices, grouped in lists of 4. Output P yields a list of points to which the tetra indices correspond.
3 - Output I yields a DataTree of edge indices, grouped in lists of 2. Output P yields a list of points to which the edge indices correspond. Useful for lots of things, very easy to create lines from this to plug into K2 or something for some ropey FEA (or not so ropey!) ;)
As this component can potentially create a LOT of data, especially with dense meshes, care should be taken with the MinRatio (R) input. This will try to constrain the tetra to be more or less elongated, which also means that the lower this value gets, the more tetra need to be added to satisfy this constraint. Start with very high values and lower them until satisfactory.
Hopefully shouldn't be an issue, but it's possible that you need the 2015 Microsoft C++ Redistributable.
Happy tetrahedralizing...
UPDATE: The tetgen.zip has been updated with some fixes.
UPDATE2: This is now available on Food4Rhino: http://www.food4rhino.com/app/tetrino
…
Added by Tom Svilans at 1:27am on October 24, 2017
lass BrepDeform Inherits GH_Component Public Reslist As New List(Of String) Public Sub New() MyBase.New("BrepDeform", "Deform", _ "移动物件的控制点" & vbCrLf & "(Move the control Point to change a object)", "SEG", "Modify")
End Sub Public Overrides ReadOnly Property ComponentGuid As System.Guid Get Return New Guid("8226e0ea-ed6b-47c2-8a24-244f044152d8") End Get End Property Protected Overrides ReadOnly Property Internal_Icon_24x24() As System.Drawing.Bitmap Get Return My.Resources.SEG_BrepDeform End Get End Property Protected Overrides Sub RegisterInputParams(ByVal pManager As GH_Component.GH_InputParamManager) ' pManager.AddTextParameter("Guid", "Id", "将要被替换的犀牛物件" & vbCrLf & "(RhinoObjects that will be replaced)", GH_ParamAccess.item) 'Dim guidParam As New Param_Guid pManager.AddParameter(New Param_Guid, "Guid", "Id", "将要被替换的犀牛物件" & vbCrLf & "(RhinoObjects that will be replaced)", GH_ParamAccess.item) pManager.AddPointParameter("ControlPoint3d", "C", "控制点的位置" & vbCrLf & "(Control Point's location)", GH_ParamAccess.item) pManager.AddPointParameter("NewPoint3d", "P", "新控制点的位置" & vbCrLf & "(New Control Point's location)", GH_ParamAccess.item) pManager.AddNumberParameter("Tolerace", "T", "输入点与物件实际控制点对比的精度" & vbCrLf & "(Tolerace for the Control Point match)", GH_ParamAccess.item, 0.1)
pManager.AddBooleanParameter("BlMove", "M", "如果是True则进行移动" & vbCrLf & "(If true Perform the Move)", GH_ParamAccess.item, False)
End Sub Protected Overrides Sub RegisterOutputParams(ByVal pManager As Kernel.GH_Component.GH_OutputParamManager) pManager.AddTextParameter("Result", "RG", "结果列表" & vbCrLf & "(Result)", GH_ParamAccess.list) End Sub Public Overrides ReadOnly Property Exposure As GH_Exposure Get Return GH_Exposure.primary End Get End Property
Protected Overrides Sub SolveInstance(ByVal DA As Kernel.IGH_DataAccess) If Banner.astrict.showmessage Then Return Dim Ids As Guid = Guid.Empty 'Dim Ids As String = String.Empty Dim tpt As Point3d = Point3d.Unset, opt As Point3d = Point3d.Unset Dim tolar As Double = 0.1 Dim blMove As Boolean = False If Not DA.GetData(0, Ids) Then Return If Not DA.GetData(1, opt) Then Return If Not DA.GetData(2, tpt) Then Return If Not DA.GetData(3, tolar) Then Return If Not DA.GetData(4, blMove) Then Return If Not blMove Then GoTo line1 Reslist.Add(Now & "_未替换!(Replace failed!)") Else Reslist.Clear() ' Grasshopper.Instances.ActiveCanvas.ModifiersEnabled = False End If
' rt.AddRange(docobjlist.Select(Function(geoobj As RhinoObject) GH_Convert.ObjRefToGeometry(New ObjRef(geoobj.Id)))) 'Private Checked(5) As Boolean, Namestr() As String = {"Point", "Curve", "Brep", "Mesh", "TextDot", "TextEntity"}
Try
Dim rh As RhinoDoc = Rhino.RhinoDoc.ActiveDoc Dim rhobj As RhinoObject = rh.Objects.Find(Ids) ' Dim rhobj As RhinoObject = rh.Objects.Find(New Guid(Ids))
Dim bobj As BrepObject = CType(rhobj, BrepObject) RhinoApp.RunScript("Cancel", False) RhinoApp.RunScript("Cancel", False) bobj.Select(True)
RhinoApp.RunScript("_SolidPtOn", False) Dim gobjs As GripObject() = bobj.GetGrips ' rh.Views.RedrawEnabled = False For Each grpobj As GripObject In gobjs
If grpobj.CurrentLocation.DistanceTo(opt) < tolar Then grpobj.Select(True) Dim CurrentPln As Plane = RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.ConstructionPlane Dim tropt As New Point3d(opt), trtpt As New Point3d(tpt) tropt.Transform(Transform.PlaneToPlane(Plane.WorldXY, CurrentPln)) trtpt.Transform(Transform.PlaneToPlane(Plane.WorldXY, CurrentPln))
Dim movestr As String = "_move " + String.Format("{0},{1},{2} ", tropt.X, tropt.Y, tropt.Z) + String.Format("{0},{1},{2} _Cancel _Cancel", trtpt.X, trtpt.Y, trtpt.Z) RhinoApp.RunScript(movestr, True) grpobj.Select(False) End If
Next
'RhinoApp.RunScript("Cancel", False) 'RhinoApp.RunScript("Cancel", False) '' rh.Views.RedrawEnabled = True Reslist.Add(Now & "_替换成功!(Replace Success!)") Catch ex As Exception Reslist.Add(Now & "_替换失败!(Replace failed!)" & vbCrLf & ex.Message)
End Try ' Grasshopper.Instances.ActiveCanvas.ModifiersEnabled = True
line1: DA.SetDataList(0, Reslist) End Sub
'Private Sub Testt_PingDocument(sender As IGH_DocumentObject, e As GH_PingDocumentEventArgs) Handles Me.PingDocument ' Dim Mbool = Aggregate bcbool In Checked Into cb = Any(bcbool)
' If Not Mbool Then ' Checked(0) = True ' Message = Namestr(0) ' Order = 0 ' End If 'End Sub
End Class
The picture below shows the two question.
Question One I must use data dam, or the component can't batch deal the brep. I don't know why, I have You can give me a solution to make it working normal not using the data dam
Question Two I can not uset the Button component, If I use it, the gh canvas will die with some mouse event--. I have see this problem before in this forum,but there is no solution and explain. I want to know why and How to solve it.
I don't know if I have made my question clear,if not give a message. Thank you! Thank you all.
The gh test file and 3dm test file in the upload files.
…
.
Things have been working swimmingly in many areas of the plugin, but one particular problem has been tough to solve. I have two components that are trying to read/write to the same memory at the same time, causing Rhino exceptions and crashes.
The conflicts appear to be happening between two components -- one is a "Layer Events Listener" that reports essentially what type of layer event just happened. The other is a "Set Layer Visibility" component that toggles the visibility of a list of layers.
The code:
public class LayerTools_LayerEventsListener : GH_Component { /// <summary> /// Initializes a new instance of the LayerTools_LayerListener class. /// </summary> public LayerTools_LayerEventsListener() : base("Layer Events Listener", "Layer Listener", "Get granular information about the layer events happening in the Rhino document.", "Squirrel", "Layer Tools") { }
/// <summary> /// Registers all the input parameters for this component. /// </summary> protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) { pManager.AddBooleanParameter("Active", "A", "Set to true to listen to layer events in the Rhino document.", GH_ParamAccess.item, false); pManager.AddTextParameter("Exclusions", "E", "Provide a list of exclusions to stop reading specific events (Added, Deleted, Moved, Renamed, Locked, Visibility, Color, Active).", GH_ParamAccess.list); pManager[1].Optional = true; }
/// <summary> /// Registers all the output parameters for this component. /// </summary> protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) { pManager.AddBooleanParameter("Initialized", "I", "Whether the listener changed from passive to active.", GH_ParamAccess.item); pManager.AddTextParameter("Document Name", "doc", "Name of the Rhino document that is changing.", GH_ParamAccess.item); pManager.AddTextParameter("Layer Path", "path", "Path of the modifed layer.", GH_ParamAccess.item); pManager.AddIntegerParameter("Layer Index", "ID", "Index of the modified layer.", GH_ParamAccess.item); pManager.AddIntegerParameter("Sort Index", "SID", "Sort index of the modified layer.", GH_ParamAccess.item); pManager.AddTextParameter("Event Type", "T", "Type of the modification.", GH_ParamAccess.item); pManager.AddBooleanParameter("Added", "A", "If the layer has been added.", GH_ParamAccess.item); pManager.AddBooleanParameter("Deleted", "D", "If the layer has been deleted.", GH_ParamAccess.item); pManager.AddBooleanParameter("Moved", "M", "If the layer has been moved.", GH_ParamAccess.item); pManager.AddBooleanParameter("Renamed", "R", "If the layer has been renamed.", GH_ParamAccess.item); pManager.AddBooleanParameter("Locked", "L", "If the layer locked setting has changed.", GH_ParamAccess.item); pManager.AddBooleanParameter("Visibility", "V", "If the layer's visibility has changed.", GH_ParamAccess.item); pManager.AddBooleanParameter("Color", "C", "If the layer's color has changed.", GH_ParamAccess.item); pManager.AddBooleanParameter("Active", "Act", "If the active layer has changed.", GH_ParamAccess.item); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { bool active = false; List<string> exclusions = new List<string>();
DA.GetData(0, ref active); DA.GetDataList(1, exclusions);
RhinoDoc thisDoc = null;
bool initialize = false;
string dName = null; string activePath = null; int layerIndex = -1; int sortIndex = -1; string eventType = null; bool added = false; bool deleted = false; bool moved = false; bool renamed = false; bool locked = false; bool visibility = false; bool color = false; bool current = false;
if (active) { thisDoc = RhinoDoc.ActiveDoc;
initialize = (!previouslyActive) ? true : false;
RhinoDoc.LayerTableEvent -= RhinoDoc_LayerTableEvent; RhinoDoc.LayerTableEvent += RhinoDoc_LayerTableEvent; previouslyActive = true;
} else {
RhinoDoc.LayerTableEvent -= RhinoDoc_LayerTableEvent; previouslyActive = false; }
if (ev != null) { dName = ev.Document.Name; layerIndex = ev.LayerIndex; eventType = ev.EventType.ToString();
if (!exclusions.Contains("Active")) { if (ev.EventType.ToString() == "Current") { // active layer has just been changed current = true; }
}
if (!exclusions.Contains("Moved")) { if (ev.EventType.ToString() == "Sorted") { // active layer has just been changed moved = true; }
}
if (!exclusions.Contains("Added")) { if (ev.EventType.ToString() == "Added") { // layer has just been added activePath = ev.NewState.FullPath; added = true; }
}
if (!exclusions.Contains("Active")) { if (ev.EventType.ToString() == "Deleted") { // layer has just been added
deleted = true; } }
if (ev.EventType.ToString() == "Modified") { // layer has been modified activePath = ev.NewState.FullPath;
//skip sortindex eventType = ev.EventType.ToString();
if (ev.OldState != null && ev.NewState != null) { if (!exclusions.Contains("Locked")) { if (ev.OldState.IsLocked != ev.NewState.IsLocked) locked = true;
} if (!exclusions.Contains("Visibility")) { if (ev.OldState.IsVisible != ev.NewState.IsVisible) visibility = true; }
if (!exclusions.Contains("Moved")) { if (ev.OldState.ParentLayerId != ev.NewState.ParentLayerId) moved = true; }
//if (ev.OldState.SortIndex != ev.NewState.SortIndex) moved = true; if (!exclusions.Contains("Renamed")) { if (ev.OldState.Name != ev.NewState.Name) renamed = true; }
if (!exclusions.Contains("Color")) { if (ev.OldState.Color != ev.NewState.Color) color = true; } }
} }
DA.SetData(0, initialize); DA.SetData(1, dName); DA.SetData(2, activePath); DA.SetData(3, layerIndex); DA.SetData(4, sortIndex); DA.SetData(5, eventType); DA.SetData(6, added); DA.SetData(7, deleted); DA.SetData(8, moved); DA.SetData(9, renamed); DA.SetData(10, locked); DA.SetData(11, visibility); DA.SetData(12, color); DA.SetData(13, current);
}
static bool previouslyActive = false; Rhino.DocObjects.Tables.LayerTableEventArgs ev = null;
void RhinoDoc_LayerTableEvent(object sender, Rhino.DocObjects.Tables.LayerTableEventArgs e) { ev = e;this.ExpireSolution(true); }
And for the layer visibility component:
public LayerTools_SetActiveLayer() : base("Set Active Layer", "SetActiveLayer", "Set the active layer in the Rhino document.", "Squirrel", "Layer Tools") { }
/// <summary> /// Registers all the input parameters for this component. /// </summary> protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) { pManager.AddBooleanParameter("Active", "A", "Set to true to change the active layer in Rhino.", GH_ParamAccess.item, false); pManager.AddTextParameter("Path", "P", "Full path of the layer to be activated.", GH_ParamAccess.item); }
/// <summary> /// Registers all the output parameters for this component. /// </summary> protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) { pManager.AddIntegerParameter("Layer ID", "ID", "Index of layer that has been activated.", GH_ParamAccess.item); pManager.AddBooleanParameter("Status", "St", "True when the layer has been activated.", GH_ParamAccess.item); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { bool active = false; string path = "";
if (!DA.GetData(0, ref active)) return; if (!DA.GetData(1, ref path)) return;
int layer_index = -1; bool status = false;
if (path != null) {
Rhino.RhinoDoc doc = Rhino.RhinoDoc.ActiveDoc; Rhino.DocObjects.Tables.LayerTable layertable = doc.Layers;
layer_index = layertable.FindByFullPath(path, true);
if (layer_index > 0) { // if exists RhinoDoc.ActiveDoc.Layers.SetCurrentLayerIndex(layer_index, true); status = true; } }
DA.SetData(0, layer_index); DA.SetData(1, status); }
Now originally I was getting exceptions when changing multiple layers' visibility properties, which would cause the Event Listener to fire and try to read the Visibility property before the memory has been released by the Set Layer Visibility component. That led me to add an "Exceptions" input, that would allow me to disable the reading of Visibility events at the source in the Layer Events listener. That helped me manage about 95% of the crashes I was getting, but I still get strange crashes in other event properties, even when that property shouldn't be affected. For instance, I am getting a crash here on the Name property in the event from the delegate function, even though I am only changing Visibility at any one time:
I have a few ideas but they all seem pretty hacky. One is to try to set a flag that is readable by any component in the plugin -- so that the event listener can see if a "set" component is currently running and abort before causing an exception. The other is creating a delay in the event listener, somthing like 200ms, to allow any set components to finish what they are doing before reading the event. Neither seems super ideal.
Any ideas?
Thanks,
Marc
…
nter the programming world and tinker more complex, interactive solutions. We will also explore advanced programming paradigms. There is no class official programming language, as both C# and Vb.Net are possible on the participant’s side, and all examples will be provided in both C# and Vb.Net. Additionally, we will see how to get started writing full .Net plug-ins. Finally, we will have time to explore user’s own proposals on the third day.
Day 1 Morning: programming introduction in .Net
• The Grasshopper scripting components. Choosing a .Net language. Language developments
• Variables declaration, assignment and utilization. Operators. Methods [functions]. Calls
• Classes: declaration and instancing. Constructors. Importing a namespace. On3dPoints, OnLines
• Arrays declaration and usage. Lists. Adding to arrays and lists, advantages and opportunities.
Afternoon: patterns
• About OOP (object oriented programming) as opposed to procedural programming. Discussion
• Example of OOP good code reuse: sorting points by coordinates using the .Net SDK classes
• Lists as input parameters. Trees as input parameters. Usage and limitations
• Finding resources: on the net with website that can help getting started and troubleshoot. And books
Day 2 Morning: extending Grasshopper functionality with our definitions
• Store data between updates. The use of fields [globals, or static locals]
• Examples on how to use stored data between updates: a simple agents simulation
• Baking geometry with scripting directly into the Rhino document. Baking with names
• Passing custom types from a scripted component to another one. Our own code reusability
• Rendering an animation from Grasshopper. How to get started and final results
Afternoon: customizing our tools
• Our Rhino plug-in with Visual Studio C# [Vb.Net] Express Edition & wizard. Parametric mesher
• Writing a custom Grasshopper component: hacking an exporter for our data to Excel
Day 3 All day: personal project
• Rehearsal on any example from the first two days. A project that you want to start on your own, being it a Rhinoceros plug-in, a Grasshopper assembly or a script. Example might be to send data through network with UDP to Processing
MINIMUM REQUIREMENTS
A good foundation of Grasshopper visual programming is mandatory. You will need a level which corresponds to the Grasshopper 101 course outline. Examples of things that will not be covered in this course are: sorting document spheres by diameter, paneling of a surface with grasshopper components. You are expected to already know these from the Grasshopper course.…
to enter the programming world and tinker more complex, interactive solutions. We will also explore advanced programming paradigms. There is no class official programming language, as both C# and Vb.Net are possible on the participant’s side, and all examples will be provided in both C# and Vb.Net. Additionally, we will see how to get started writing full .Net plug-ins. Finally, we will have time to explore user’s own proposals on the third day.
Day 1 Morning: programming introduction in .Net • The Grasshopper scripting components. Choosing a .Net language. Language developments • Variables declaration, assignment and utilization. Operators. Methods [functions]. Calls • Classes: declaration and instancing. Constructors. Importing a namespace. Point3d, Lines • Arrays declaration and usage. Lists. Adding to arrays and lists, advantages and opportunities. Afternoon: patterns • About OOP (object oriented programming) as opposed to procedural programming. Discussion • Example of OOP good code reuse: sorting points by coordinates using the .Net SDK classes • Lists as input parameters. Trees as input parameters. Usage and limitations • Finding resources: on the net with website that can help getting started and troubleshoot. And books Day 2 Morning: extending Grasshopper functionality with our definitions • Store data between updates. The use of fields [globals, or static locals] • Examples on how to use stored data between updates: a simple agents simulation • Baking geometry with scripting directly into the Rhino document. Baking with names • Passing custom types from a scripted component to another one. Our own code reusability • Rendering an animation from Grasshopper. How to get started and final results Afternoon: customizing our tools • Our Rhino plug-in with Visual Studio C# [Vb.Net] Express Edition & wizard. Parametric mesher • Writing a custom Grasshopper component: hacking an exporter for our data to Excel Day 3 All day: personal project • Rehearsal on any example from the first two days. A project that you want to start on your own, being it a Rhinoceros plug-in, a Grasshopper assembly or a script. Example might be to send data through network with UDP to Processing MINIMUM REQUIREMENTS A good foundation of Grasshopper visual programming is mandatory. You will need a level which corresponds to the Grasshopper 101 course outline. Examples of things that will not be covered in this course are: sorting document spheres by diameter, paneling of a surface with grasshopper components. You are expected to already know these from the Grasshopper course.…
y (movement, protection, temperature regulation) but also the evolution of cultural expression precisely by exceeding the purely indexical performative relations. Designing not only for the needs but for the desires.
Computational couture looks at the creation of exclusive custom-fitted clothing (typical of haute couture) through the lens of a systemic approach, extending the sartorial techniques with 3D modeling and computation-based approaches developed in Rhinoceros and the visual programming environment Grasshopper.
Aim of the workshop is to exert, infuse and expand the sartorial sensibilities to body proportions and dress making into an algorithmic approach that loops through design and fabrication by means of laser cutting and 3d printing for the design and production of a garment. Participants will be divided in teams focusing on specific aspects of the garment related to the production technique (laser cutting or 3D printing).
////////////////////////////////////
WORKSHOP | calendar
Day 1
Introduction to algorithms and computational design for creative disciplines Basics of 3D modeling in Rhinoceros Basics of Grasshopper Introduction to basic sartorial techniques
Day 2 Testing design options for the dress in Grasshopper (tutored work)
Day 3 Fabrication session . file preparation . parts testing and pre-assembly
Day 4 dress fabrication and assembly
Day 05 finalization of dress final presentation
////////////////////////////////////
WORKSHOP | registration
FEE FOR PARTICIPANTS
Early bird (until 4/5): 250 € Full fee (from 5/5 until 15/5): 350 €
The fee includes materials and fabrication. Plane tickets and accommodation are not included in the fee.
////////////////////////////////////
REGISTRATION (until 15/5/2015)
For registration please write at :
beyond@iaac.net
for more info visit:
http://beyond.iaac.net/?page_id=1620
…
rectly except for the first material in a series. See attached image... Here is my code:
Private Sub RunScript(ByVal M As Object, ByVal C As Color, ByRef AddName As Object, ByRef AddMat As Object, ByRef AddBool As Object, ByRef baseName As Object, ByRef newMatName As Object)
Dim z As String = "newMatName" Dim y As String = "BaseName" Dim x As Integer = 0 Dim nRestore As String Dim mTemp As Rhino.DocObjects.Material
mTemp = CType(M, Rhino.DocObjects.Material) y = mTemp.Name Dim nTemp As String
If mTemp.Name.Contains("_MOD_R") = False Then
nRestore = mTemp.Name nTemp = mTemp.Name & "_MOD_R" & C.R & "_G" & C.G & "_B" & C.B mTemp.Name = nTemp z = nTemp mTemp.DiffuseColor = C
If Doc.Materials.Find(nTemp, True) < 0 Then
Doc.Materials.Add(mTemp) x = x + 1 AddName = nTemp AddMat = mTemp
End If
mTemp.Name = nRestore
End If
newMatName = z
AddBool = x BaseName = y
End Sub
1) I have checked that all of the materials I am calling by name exist in the document and that data matching is correct. There doesn't seem to be anything special about the offending material except that it is always the first material that was added to the document by my script.
2) The main thing I was missing in the previous script was the "doc.Materials.Add()" -- how on earth should I have known that existed? Even a search for "doc.Materials" in the Rhinocommon SDK doesn't turn that up. I'm having a very hard time using the SDK to my advantage, it seems not to correlate to the actual code I need to write.
2b) Perfect example... now I am trying to rewrite my other component (which exposes all of the document materials) to set a few objects manually in Rhino with the Materials I want to use as templates. Now I am trying to find out how to access the material assigned to an object. Seems easy, but it's clearly not a Property, and I can't find an appropriate Method in either the Objects or Materials classes.
3) One of my problems originally, when feeding the component one material and multiple colors, was that the nTemp variable was not resetting properly for the second color. Same thing if I duplicated the material to match the list of colors. It would create a material on the first pass but concatenate "_MOD_R_G_B" in each subsequent pass and be caught by my String checker. Why is that? I thought that the nTemp Name variable would be reset in each pass by the line "mTemp = CType(M, Rhino.DocObjects.Material)" and "nTemp = mTemp.Name" combination.
Does the mTemp material somehow carry over its properties in each successive pass? That's why I added the nRestore to be sure each pass reset the name back to the original.
Still, I wonder if there is some problem with the way I am conceptualizing this that is causing the first material to be the same as the input material.
Thanks for your help on this...
Cheers,
Marc…
a machine that is light and very sturdy. I have taken my Macbook Pro all around the world, carry it with me every day, even dropped it a few times and its still totally fine. Its thin and light.
2) You get some actual support for your hardware even a few years down the line. My Macbook Pro is from 2012 and I can still walk in to any Apple Store and get help with it, which I have done many, many times in different places around the world - I never had to show a receipt or was charged any money for help. There is no PC/Laptop manufacturer in the world with anything close to that, because companies like Asus, Dell, etc. bring out dozens of new versions of laptops every year, so its much harder to service them after a few years.
3) This is the most important one, which usually people forget when they say that Macbooks are overpriced: Resale Value. If you have ever tried to sell an old PC/Laptop (I have a few times), you will know how little value they have even after just 2-3 years. Macbooks retain their value very well and even after 4 years you can still get 50% of your original price.
4) Of course you can install Windows on it and it runs perfectly. I have MacOS and Windows on it and both run absolutely fine. On the Windows side I have Rhino+GH, Maya and a few others. Having Windows is good, because some software still only runs on Windows (looking at you, 3DSMax!). Most other software also runs on MacOS. In the interest of sanity it is great to have an alternative to Windows for all the day to day stuff, like Mail, Calender, Photos, Presentations, etc. that just always works.
5) As for performance: Yes, Macbook Pros dont necessarily have the latest and greatest in graphics cards (the rest is on par with PC laptops), but unless you want to play games you will not need it. VRay RT can do GPU rendering, but you wont get great performance from a Notebook GPU anyways and it doesnt make sense to do rendering on a laptop (especially since you have a workstation). You could get one of the older Macbook Pro Retina Late 2013 or Mid 2014 models with the GTX750M by Nvidia, which will be usable to render using VRay RT, but of course not huge performance. Better to invest in a good used graphics card for your workstation like an Nvdia GTX980ti, which is the best value for money for GPU rendering right now (lots of used ones available).
So at least consider also getting a Macbook Pro. You can buy refurbished models (depending where you are) and they are like new, but a lot cheaper or even get an older one thats used. It will be a worthwile investment.
Take it from someone who has used dozens of PCs and Macs in my lifetime and have to do the IT support here at work (where we also use both).
I still have my Macbook Pro Retina from 2012 and its still running perfectly, super fast, and I can use Rhino and GH for huge files, do GPU Rendering with Octane Render and all sorts of other heavy computing stuff.
Hope that helps.…
Added by Armin Seltz at 11:12am on September 19, 2016
Python and install it and it should work fine.
2. You still see the image above in case 1 however you have GHPython already installed. What about that?
In this case probably the GHA component is blocked. Find GHPython.GHA on your system (usually at: C:\Users\%username%\AppData\Roaming\Grasshopper\Libraries) . Right click, go to properties and select unblock.
To make sure that GHPython is working fine on your system open the attachment file (testGHPython.gh). You should see something similar to the image below on your screen when you open the file:
If you see the something similar you should be fine to go! Try to open one of the example files.
3. You have Ladybug running but in some of the case the output is missing. You see something similar to this:
or this
This one is because you are using old version of GHPython. Close the file without saving. Download the new version and install it and re-open the file. It should work fine now.
Hope it helps,
Mostapha
…
the mesh into long strips 1 quad wide.
*I did make an alternative icon for this, but opted for the tamer one in the end ;)
The Unroller component goes along the strip face by face, rotating it into a single plane.
Note that this component will still give a result even if you supply it with non planar quads - it will just fold them along a diagonal. However, if the faces are significantly non-planar, then it won't work as well for fabricating from a smooth strip of sheet material, so it is better to try and make sure your planarizing in the relaxation part is working well.
The Unroller component also has a T input which allows you to unroll only part of the mesh at a time. This is mainly for animation purposes, and most of the time you will probably just want to leave it set at 1.
At the moment the unroller is limited to working with open strips, so if your strip forms a closed loop, you will have to split it first. Later releases should include an automatic 'loop snipper'.
The final part of the definition then takes all these strips, orients them into the XY plane, and does some very basic layout.
It's then up to you to label, add tabs, nest, laser cut and assemble!
Because of the subdivision, each strip should have an even number of quads, which can also be useful for generating interlocking tabs by offsetting alternate groups of edges. I'll try and post an example of this soon.
I hope this is helpful. It was my intention when making this that it could be a relatively quick and easy way of making smooth curved structures out of sheet material, (I'm thinking card, polypropylene, metal, thin plywood...) with a lot less fixing/connecting work than doing a similar shape with individual panels.
Thanks to all the participants in these long-running threads:
http://www.grasshopper3d.com/forum/topics/how-to-create-nodesbone
http://www.grasshopper3d.com/forum/topics/skeletal-mesh*
which inspired this work, especially some of the comments by Ivan Kiryakov, Wiktor Kidziak, Giulio Piacentino, Andrew Haas and Mårten Nettelbladt.
*note also that the meshes generated using this definition can be used for developable strips, because they have the even-valence property.
I was also inspired by these papers:
http://www.cs.jhu.edu/~misha/Fall09/Liu06.pdf
http://www.geometrie.tugraz.at/wallner/strip.pdf…