Grasshopper

algorithmic modeling for Rhino

Hi,

I am going to produce some perspective and axonometric drawings with textTags to show the names of some elements. The problem is I have to manually rotate the testTag plane to make the texts parallel to the view so as to see the text clearly. Everytime I choose a new perspective, I have to adjust all the textTags manually again. I have searched  all the methods related to views and cameras in SDK but failed to find out how to write a c# component  in Grasshopper to realize this. I'd really appreciate any help you could offer.

Thanks!!!

-Jerome

 

Parallel to the user means something like this

Views: 897

Replies to This Discussion

Hi Gerome.

I wrote something for that purpose in VB.
It is only a rough trail but it does it quite simply :

The first VB retrieves planes from the input points origins, parallel to the current active rhino viewport (eg perspective...) scanned on every Timer event (THE TIMER COMPONNENT MUST BE ENABLED FOR THE PREVIEW). Display goes via the Tag componnent.
Once you are OK with your viewport display, freeze the Timer and then "take the picture" : The Baking action is activated with the Boolean Toggle componnent (just toggle once completely for baking : basicaly set to false, toggle to true and then to false again unless you would bake new text on every Grasshopper update and even crash Rhino...).

I have separated the code in several VB componnents for a better clarity while testing and
"VB Legacy componnents" means that the code uses the "Rhino 4 .NET SDK" objects, not the new "RhinoCommon SDK".

The "On Frustrum Plane" Boolean Toggle should give the ability to project the reference planes (where to draw the texts ) onto the viewport's frustrum plane... if I didn't fail to get an access to it... It would be great because it seems to be the only way to flatten the Z depth and thus to get all the texts displaying the same size on a perspective view ...


Enjoy, and let me know about it in C# !
Attachments:

Thanks!

Stanislas,

I rewrote your definition in C# with Rhinocommon and I think your idea of projection to the frustum plane is right, but it seems that it only works when the display of the viewport is set to parallel projection mode. I am still not clear about how the camera, view, viewport, frustum, clipping plane works in Rhino, it always makes me puzzled whenever I am scripting or not. Do you have any website or materials on this? Thanks!!!

 

Thanks again!

-Jerome

Attachments:

Hi Gerome.

 

See

many samples (list) at http://wiki.mcneel.com/developer/dotnetplugins#Samples

and specially one of them : http://wiki.mcneel.com/developer/sdksamples/drawstring

 

Thanks!

 

I've seen through all the examples using Rhinocommon but never realized this treasure.

Thanks!

 

-Jerome

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service