algorithmic modeling for Rhino
Hello all
so i've been playing around with this for a while.
and even used the opportunity to try and pick up a bit of beginner python if necessary.
i've got these original meshes in rhino with textures mapped already.
and i want to move them in rhino according to a list of values (in Z axis- easy) i've created in GH - specific to their order obviously.
* [just for interest- basically i'm trying to "drape" 3d buildings from a curved aerial ground mesh to a flat one. so each mesh has a different z value it needs to move with.]
i've been trying to do this through GH or python with out success,
I understand i can create a list of the Z axis values, and also a list of the meshes IDguides to be recognized in rhinosyntax (so i can select them by id)
any thoughts ? please ?
thanks very much
Tags:
If you'd like to transform the objects directly in Rhino, it's easy enough to do so:
http://wiki.mcneel.com/developer/rhinocommonsamples/transformbrep
The Rhinocommon wiki has loads of good examples. You generally need to alter how the objects are selected/assigned, and it's also useful to activate your code with a boolean input.
thank you david !
for responding firstly :)
it looks as though you've understood me, but unfortunately i've not yet completely understood what you meant :)
what is the workflow if you dont mind helping me out a bit more?
1.code in python everything?
2.or just the input method into GH?
i'm afraid the whole process in python will take me years :) as i've already measured for each mesh centroid the z delta to the new location...
thanks very much
amir
let me just clarify as i'm probably not so clear..
i've got already textured meshes in rhino which i need to transform (move on z axis) with different value for each mesh.
i'm able to compile a list of values and obviously move these meshes to the right place accordingly but the new meshes i bake are without the textures (obviously.. sadly.)
so i'm looking for a way to transform (perhaps that's what you're suggesting) the original meshes with the list of values i've come up with
Or anyother way you can kindly suggest?
thanks very much
:)
Yes...I mean that you can directly move the Rhino geometry through any script component in grasshopper. The key lies in getting the correct reference information from your geometry in rhino...but then you can transform your geometry just as you would in Rhino, not having to bake or remap, etc.
I don't use python myself (I use vb.net) but I think this discussion should help you read the object id's in rhino.
http://www.grasshopper3d.com/forum/topics/finding-guids-in-python
The sample script I linked to from the rhinocommon wiki should give you all the syntax you need to transform your objects.
There are several logical problems though:
I don't have ready answers to these problems, they really are actual problems that will need to be solved on a per-project basis. Based on your description of what you want to achieve, I think RhinoScript is probably a better approach than Grasshopper.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks David-s :)
Well, first things first- i've managed (what i regard as a sufficient workaround) - using "Human" utilities by andrew heumann - for figuring out the referenced geometry's materials - in this case - the actual textures. - i was surprised to find out with just a custom bake component - to bake the attribute to the new geometry created in GH- images attached.)
Basically that's exactly what I thought I was looking for initially but then I realized I was lost when it came to the relationship between GH and rhino. I'm not sure I'm there yet having read your answers (my lack of coding background I presume) but I'm trying to figure it out:
* So python inside GH is basically a way to reach out to the rhinoscriptsyntax? To the more "hardcore" or basic code of rhino? But once doing this inside GH, all Geometry is referenced already and is sequential? Is this referring to David (Rutten) philosophical answer? If so, then I think I understand.
* Also- David (Rutten :) ) – when you say at the end of your answer- that you suggest rhinoscript- do you mean "outside – "in the cold" :) - in rhino? with the pythoneditor?
As always, many thanks
I use the line owner.locked = true at the end of a script to make it run only when I want (by enabling the component) and avoid the problems David mentions.
Not sure if there is any catch using this method, it has always worked fine for me.
There's also now a boolean button component but I think if the component runs faster than the time it takes you to unclick it might run more than once.
thanks so much David !
please see my reply to David Rutten above and the "workaround" GH approach i ended up taking.
The direction you've pointed me to - looks like exactly what i thought i had in mind - but unfortunately- well above my head for the moment... :(
cheers again
:)
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by