rsistant data , as the inputs and outputs of the component should be build by the data stored in the object.
thanxs in advance
Michael
here is the code of the object....
public class Proxy { public List<string> _name_in; public List<string> _name_out; public List<SerializableType> _type_in; public List<SerializableType> _type_out; public List<GH_ParamAccess> _access_in; public string _path; public string _script; public bool _internalized; public bool _working; public Proxy(List<string> name_in, List<string> name_out, List<SerializableType> type_in, List<SerializableType> type_out, List<GH_ParamAccess> access_in, string path, string script, bool internalized) { _name_in = name_in; _name_out = name_out; _type_in = type_in; _type_out = type_out; _access_in = access_in; _path = path; _script = script; _internalized = internalized; _working = true; } public Proxy() { _name_in = new List<string>(); _name_out = new List<string>(); _type_in = new List<SerializableType>(); _type_out = new List<SerializableType>(); _access_in = new List<GH_ParamAccess>(); _path = get_path_of_plugin(); _script = ""; _internalized = false; _working = false; } public static string get_path_of_plugin() { string temp_cut; string string_path = System.Reflection.Assembly.GetExecutingAssembly().Location; string string_name = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; int temp_name_int = string_name.Length + 5; int temp_path_int = string_path.Length; temp_cut = string_path.Remove(temp_path_int - temp_name_int); return temp_cut; } public static T ObjectDeserializer<T>(string XmlInput) { System.Xml.XmlDocument XmlDoc = new System.Xml.XmlDocument(); XmlDoc.Load(new System.IO.StringReader(XmlInput)); System.Xml.Serialization.XmlSerializer ser = new System.Xml.Serialization.XmlSerializer(typeof(T)); T out_ob = (T)ser.Deserialize(new System.IO.StringReader(XmlInput)); return out_ob; } public static string ObjectSerializer<T>(T SerializedObject) { System.Xml.Serialization.XmlSerializer ser = new System.Xml.Serialization.XmlSerializer(typeof(T)); System.Text.StringBuilder builder = new System.Text.StringBuilder(); XmlWriter xmllol = XmlWriter.Create(builder); ser.Serialize(xmllol, SerializedObject); return builder.ToString(); } } public class SerializableType { private Type type; // when serializing, store as a string // [DataMember] public string TypeString { get { if (type == null) return null; return type.FullName; } set { if (value == null) type = null; else { type = Type.GetType(value); } } } public Type return_Type() { return type; } // constructors public SerializableType() { type = null; } public SerializableType(Type t) { type = t; } // allow SerializableType to implicitly be converted to and from System.Type static public implicit operator Type(SerializableType stype) { return stype.type; } static public implicit operator SerializableType(Type t) { return new SerializableType(t); } // overload the == and != operators public static bool operator ==(SerializableType a, SerializableType b) { // If both are null, or both are same instance, return true. if (System.Object.ReferenceEquals(a, b)) { return true; } // If one is null, but not both, return false. if (((object)a == null) || ((object)b == null)) { return false; } // Return true if the fields match: return a.type == b.type; } public static bool operator !=(SerializableType a, SerializableType b) { return !(a == b); } // we don't need to overload operators between SerializableType and System.Type because we already enabled them to implicitly convert public override int GetHashCode() { return type.GetHashCode(); } // overload the .Equals method public override bool Equals(System.Object obj) { // If parameter is null return false. if (obj == null) { return false; } // If parameter cannot be cast to SerializableType return false. SerializableType p = obj as SerializableType; if ((System.Object)p == null) { return false; } // Return true if the fields match: return (type == p.type); } public bool Equals(SerializableType p) { // If parameter is null return false: if ((object)p == null) { return false; } // Return true if the fields match: return (type == p.type); } } public class GH_Proxy : Grasshopper.Kernel.Types.GH_Goo<Proxy> { public override Grasshopper.Kernel.Types.IGH_Goo Duplicate() { return this; } public override bool IsValid { get { return true; } } public override string ToString() { return Proxy.ObjectSerializer<Proxy>(this.Value); } public override string TypeDescription { get { return "his is a proxy"; } } public override string TypeName { get { return "his is a proxy"; } } }…
ome work to create a ZScript macro for custom routines, but you can record those in ZBrush and then merely need to edit them into my script, inline, as bulk multiple-lines you just paste in, no problem as long as you strip the ZBrush button definition at the beginning.
ZBrush has a very high initial learning curve because of its non-standard interface. However, it has the world's most powerful quad remeshing and now mesh Booleans too. I needed a replacement for slow and especially non-robust marching cubes (Cocoon/Monolith/Dodo/Aether etc. on Grasshopper) that tended to bog down or blow up. IntraLattice was a step in a good direction but it can't merge fattened lines that merely cross each other with no breaks or that physically overlap on purpose to have many curve on in to a hub. But with $800 ZBrush 4R8, the latest version, that I can create English language ZScripts for, I suddenly have, often in the blink of an eye, or at worst a few seconds, right back into Rhino Grasshopper, a perfectly joined, airtight and smoothed mesh blending of upwards of thousands of input mesh pieces that overlap in ways Rhino will never Boolean union.
There is no complicated installation of anything since it's all done in Python.
The ZBrush program itself pops up while it works, and is then automatically backgrounded to bring you back to Grasshopper. It keeps running though, for fast iterations with no program startup time.
This is a general toolkit to expose myriad very advanced features of ZBrush into being just another Grasshopper plug-in like the rest.
It works by accepting a Grasshopper mesh and writing it to disk as an OBJ file, then incorporates ZBrush settings for a given command into a text format ZScript file, also written to disk from Python based on Grasshopper inputs, then ZBrush is told to run the script via Windows command line, and the exported OBJ output is read back from disk back into a Rhino Grasshopper mesh, in about a hundred lines of code.
Despite a change in mesh definition in Rhinocommon from version 5 to 6, I made it work on both versions.
So far this is only one command, the newly improved mesh Boolean union. It gives quad meshes, but they still look healthy when quickly triangulated in Rhino (as seen on top, above).
The ZBrush ZRemesher is utterly astounding in ability to transform any mesh into a direction following, error free quad mesh that can be converted to NURBS actually, via T-Splines smooth mode. That will be the next port to Grasshopper. I hope architects pick up on this more orderly manner of patterning surfaces than the alien slime of random point Voronoi.
Commercial software has the best code, not open source stuff, so far, so this is serious work to bring world class tools into Grasshopper where we can rapidly prototype computational strategies.
Here is a thread with several examples of ZBrush Boolean union remeshing applied to 3D trusses, compared to both IntraLattice and marching cubes:
http://www.grasshopper3d.com/forum/topics/custom-unit-cell-bug-in-intralattice-plug-in?commentId=2985220%3AComment%3A1828609
The same strategy of generating script files I used to port OpenFlipper, here, for triangle remeshing, which can now be combined with ZBrush Boolean unions of arbitrary assemblies of mesh units:
http://www.grasshopper3d.com/forum/topics/best-uniform-remesher-for-patterning-organic-suraces
UPDATE: I revamped the workflow so now components feed raw ZScript into a sequencer. Then only a single ZScript is assembled and sent to ZBrush so Python never gets ahead of ZBrush (!):
It is easy to DIY roll your own now:
…
Added by Nik Willmore at 6:48am on October 12, 2017
utput. A typical parametric analysis involves either toggling input parameters while observing an output response in a cyclic trial and error feedback loop, or by adopting an optimisation approach to search for the 'best' output value based on some target of interest (e.g. in parametric simulation analysis studies).
Either-way, it remains cognitively difficult to keep track of input-output relationships, especially in multi-input parameter scenarios. Furthermore, optimisation outcomes are one-off outcomes that do not provide insight into the underlying input-output causality that is responsible for generating the output in the first place. As a result, it becomes challenging to control the computational workflow intuitively.
Inference Lab is a plug-in that overcomes such challenges by introducing bi-directionality between inputs and outputs, within Grasshopper. In other words, Inference Lab facilitates both forward and inverse computations. An inverse computation implies the ability to set a target output value of interest and instantly reveal the input distributions that are likely to cause the set target. This facilitates an instant cross-section of the input-output mapping. Inference Lab enables interaction with the input and output distributions to explore the cause and effect bi-directionally.
The following demo video illustrates the potential of Inference Lab for a structural design scenario. Given a typical parametric FEA simulation set up, Inference Lab was used to identify 1) how the design parameters influence the maximum deflection and the weight of the cantilever truss structure, and 2) identify the parameter ranges that satisfy specified targets on max deflection and weight.
Under the hood, Inference Lab builds a statistical representation of the input-output workflow from data that is generated automatically from the parametric definition within Grasshopper. The statistical representation takes advantage of a marriage between machine learning and Bayesian inference (a classic technique from probability theory).
More literature about the research underlying Inference Lab can be found here.
Inference Lab is presently composed of four main components: 1) PSlider, 2)POutput, 3)DataGenerator, 4)Model Builder.
Notes:
Inference Lab is a by-product of my very recent PhD work so please forgive me for the lack of information. I intend to update this page with structured tutorials explaining the potential of Inference Lab in various scenarios.
The Inference Lab plug-in is not yet available for download as I am in the process of ironing out a few minor issues. I hope to share an alpha version very soon. …
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
…
metric/parəˈmɛtrɪk/adjectiverelating to or expressed in terms of a parameter or parameters.art/ɑːt/nounthe expression or application of human creative skill and imagination, typically in a visual form such as painting or sculpture, producing works to be appreciated primarily for their beauty or emotional power.// Summer School 2017 3 day intensive workshop for design students & professionals will delve into computational & parametric methods (using Rhino3D & Grasshopper3D) to create data-driven art installations, physically manifested into a space through hands-on fabrication & assembly.The experimental studio will run across 2 cities in India (New Delhi & Mumbai) and investigate the agenda of ‘filling the void’ at art installation scale, through the use of computation and parametric methods. Studio is designed as a 3-day event in both cities comprising of technical tutorials, teaching sessions, prototyping & presentations culminating in a symposium / round-table conference / open discussion with leading / emerging professionals that demonstrate computation, parametric design or alternative techniques in their work / practice / academia. // Cities & Dates*New Delhi – 30th June to 2nd July 2017 (Friday to Sunday)Mumbai – 7th July to 9th July 2017 (Friday to Sunday)//VENUE: DELHI: Startup Tunnel, Vihara Innovation CampusD-57, 100 Feet Rd, Pocket D, Dr Ambedkar Colony, Chhattarpur, New Delhi - 110074MUMBAI: Raffles Design International, MumbaiHi Life, 2nd Floor, Phirozshah Mehta Road,Santacruz (W). Mumbai – 400054// Registration DatesAll Registrations End 4 days prior to workshop start date (Or till seats last)// About rat[LAB] EDUCATIONrat[LAB] EDUCATION is an initiative by rat[LAB]-Research in Architecture & Technology (www.rat-lab.org) to start a new discourse in architecture & parallel design disciplines with the use of ‘computational design’ & it’s various subsets. Spread across various cities / countries, we are establishing a global dialogue in the domain of computational design by actively organizing and participating in workshops, lectures, presentations & symposia. While rat[LAB] has taken a top-down approach of exploring computational design through industry, a parallel, bottom-up approach is also in-line to involve students of all levels, from design & related backgrounds.…
pproach that will hopefully work. There's still the last part of putting it all together, but I figured I'd post my progress so you could play around with it if you wanted. This is kind of a lucky situation since its only single face breps and simple trims that are being worked with.
I've attached 3 definitions to this post. The first is my reorganization of your original definition, which creates the surfaces from the point grid and culls out any surfaces that are not "on" the surface so that we don't have to deal with them later down the line. This is done through a small VB component which determines whether any of the corner points lie on the surface. If it does it keeps the surface, if not, then it doesn't. The only issue with this is that in your example file, there are some surfaces which the corner points do not lie on the surface, yet the surface that they create spans the underlying surface. At this point I'm not worrying about those. You mentioned that you only want the surfaces that lie at the edge...this can be done by testing whether all 4 corner points lie on the trimmed surface or not.
The second definition is a coded version of the project function. In the example it will project to all the breps supplied, yet in the final version this probably won't be desired. Also, the direction (z axis) is hard code...this could be swapped out if desired.
The third definition is an shot at trimming a surface with an input curve (that curve happens to be projected). I tried this many ways, but found that the function RhinoCutUpSurface seamed to work alright. The other attempts at doing this directly with through functions available for OnBrep were unsuccessful and very complex. Luckily because the underlying brep is an single, untrimmed surface this function works well for us, but in situations where we have a trimmed or multiface brep we'd be up a creek with out a paddle. The function creates an array of breps, but in our case it will create essentially the same surface split by our curve and joined together as a single brep with two (possibly more) faces. All we have to do is find out which face we want to keep and duplicate that into a separate brep and pass it out of the component. In the example file I'm determining which on to keep based off of the distance from a test point to the centroid of each face.
The other option here, which would trump the need for projection or trimming, would be to extrude the edge curves through the surface in question, and use the BrepSplit function which requires two breps. There would still be the need to sort out what to keep, but if this approach were used, all the split pieces would be separate breps.
So, all the pieces are pretty much working separately, all that I have left to do is put them all together in the base definition. The only thing that is really the hump with that is determining exactly which face to keep. My idea at the moment is to find out which corner of the surface does not like on the base surface and use that to determine which face will be thrown out. This might be one of the easier ways, but will not be rock solid. The other option is to pull a test point that's on one of the faces to the base surface and the other face, then use the distance from test point to the point on the base surface and the distance to the pulled point on the other face to the base surface to figure out which one to keep.
As to sectioning off parts of the solution, you could do this in a number of ways, but here's two simple ones. In a scripting component just add a boolean value to the inputs and put the whole script inside of an if statement that looks at that boolean value. With components just add a boolean gate or a null pattern componet anywhere you want in the stream. Again, hook in a boolean toggle value, and that will stop the info from going to components that are downstream.…
.
as you can see I devided it into 3 parts.
part1: when I try to connect the new shape to the rest of your definition,the plan z,which gives the panels individually when baked(so I can work them individually)doesn't work,apparently there is something missing when I want to explode it.
that is why I connected it to the definition that I already had(part2)( the only cool part about that one is the attractor point)well it kind works,but not really(if you zoom in you can see that there are some parts overlapped and really not looking good).however I much rather your definition because of the option it gives me to work with individual panels when baked(planz).
however it's around 4 am. and I have decided to make some major changes in design (to prepare some closed and open space,I'm talking about part3 that works with the fibonacci like shape,I know it doesnt look really good,but seriously 4am.!).the major problem is that I tried to make a form like that with kangaroo so the shape would be smoother but I wasnt really able to make it with kangaroo,that's why I made it manually in rhino.I was wondering if you can help me make something like this ( not exacly like this) with kangaroo or (if impossible to be made with kangaroo)even helping me optimizing it so it doesnt look as bad,as you can see when I try to work the grasshopper definition on this shape,it gives me different panel sizes for each surface and all of them are to small compared with the overall size of the so-called pavillion(give it 200-500 sq feet (20-50 sq.m).and any suggestions about the shape would be appreciated,please forgive my basic knowledge of rhino and grasshopper,and let's say I wanted to make a shape like these(don't laugh please!)
u promised not to laugh!!!
please help me find the right way!
…
make-this-form-...
Other than that:
1. Tensegrity is a "static" thingy in the sense that you use some module (let's call it "mode") and repeat. Creating some code that does INVENT new modes for T trusses (Pulitzer/EMMY/Nobel on sight, he he) ... I would strongly suggest to forget that THIS VERY MOMENT.
2. Applying some T "mode" on something (see my examples in the above thread where I use surfaces for the T nodes) is another animal. If you intend to use Kangaroo to "relax" that something (NOT the T itself) well ... you can do it but has nothing to do with T.
3. The Kangaroo def provided is a "way" to test the "rigidity" of the T in use. It's a "post-processing" thing NOT a T solving thing.
4. I have a terrible feeling: are you saying that (a) without knowing a thing (or two) from C#, (b) without knowing K1/K2, (c) with a limited GH experience ... your goal is to write down from scratch a FEA ("Femap") thingy that ALSO does node "relaxation" ? If so ... well ... what about sky diving (without parachute) or that classic Russian roulette "game"?
PS: shown double tetra (classic) and XFrames (classic) T trusses applied in open and closed surfaces.
But of course these are abstract stupid "arrangements" utterly out of question in real-life: read CAREFULLY the discussion in the thread provided above AND also study the 3dPDF attached (with a system out of many available) in order to get the gist about what real-life means (Note: EVEN if no real-parts are used ... the node calculation is different from the abstract "star" connections pictured above - by "star" I mean that cables meet at a single point in space without any "offset" etc etc).
Moral: Seppuku
Plan Z: Skype ASAP
…
d the ObjectName of a selected set of objects from a Rhino model in CSV format.
2) Opened this in Excel, Column-A contains the GUID, Column-B contains ObjectNames.
3) Modified and revised the ObjectNames in Excel.
4) Using another GH-solution, Wrote a VB script to push this modified data back into the model. However after baking, the objectName is not getting updated.
Though the solutions do not show any runtime errors, after baking, the ObjectNames are not updated. However, if I try selecting the object using:
obj.Select < - this gives an error
--------------------------------------------------------
Here is the code to my GH-solution (see attached image)
WriteToXL module:
------------------------------------------------------------------------------
Private Sub RunScript(ByVal id As Object, ByRef mName As Object, ByRef GUID As Object, ByRef A As Object) Dim obj As Rhino.DocObjects.RhinoObject = doc.Objects.Find(id)'Dim A As StringDim mP1(2) As DoubleDim mP2(2) As DoubleDim mCurve As Rhino.DocObjects.CurveObjectIf obj Is Nothing ThenmName = "Obj not found"ElseIf obj.ObjectType = Rhino.DocObjects.ObjectType.Curve ThenmCurve = objmP1(0) = mcurve.CurveGeometry.PointAtStart.XmP1(1) = mcurve.CurveGeometry.PointAtStart.YmP1(2) = mcurve.CurveGeometry.PointAtStart.Zmp2(0) = mcurve.CurveGeometry.PointAtEnd.Xmp2(1) = mcurve.CurveGeometry.PointAtEnd.Ymp2(2) = mcurve.CurveGeometry.PointAtEnd.ZEnd IfmName = CType(obj.Name, String)GUID = obj.idA = GUID.ToString & ", " & CStr(mName) & ", " & mp1(0) & ", " & mp1(1) & ", " & mp1(2) & ", " & mp2(0) & ", " & mp2(1) & ", " & mp2(2)End IfEnd Sub -------------------------------------------------------
ReadFromXL module:
-------------------------------------------------------
Private Sub RunScript(ByVal activate As Object, ByRef A As Object, ByRef B As Object, ByRef C As Object) If activate = True Then Dim XLApp As Object Dim XLSheet As Object
xlApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application") Dim strSheet As String = "ObjectName+GUID" XLSheet = xlApp.Worksheets(strSheet)
Dim strGUIDColumn As String = "A" Dim strObjectNameColumn As String = "L"
Dim iRow As Int16 Dim nRows As Int16 = XLSheet.usedrange.rows.count Dim obj As Rhino.DocObjects.RhinoObject ReDim B(nRows - 1) ReDim C(nRows - 1) ReDim A(nRows - 1) For iRow = 1 To nRows
Dim strGUID As String = XLSheet.Range(strGUIDColumn & iRow).Value Dim objGUID As Guid = New System.Guid(strGUID) Dim strObjectName As String = XLSheet.Range(strObjectNameColumn & iRow).Value obj = doc.Objects.Find(objGUID) obj.Attributes.Name = strObjectName B(iRow - 1) = objGUID C(iRow - 1) = obj.Attributes.Name A(iRow - 1) = obj Next
End If
End Sub
----------------------------------------------------------------…