Grasshopper

algorithmic modeling for Rhino

Hi,

I have some problems with ProjectPointToSurface using rhinoscriptsynthax.

when I put a direction as vector it doesn't consider the verse and compute the projection for both side of the ray. I would like to emulate the Point Project component in grasshopper.

any suggestion?

Views: 862

Attachments:

Replies to This Discussion

Hi GM,

Even though both rhinoscriptsyntax function rs.ProjectPointToSurface and grasshopper's component "Project point" sound like they do the same thing, they don't really as you have already experienced. The first one calls Intersection.ProjectPointsToBreps method, while the second one uses Intersection.RayShoot. Intersection.RayShoot method has already been implemented with rs.ShootRay rhinoscriptsyntax function but for it also adds the starting point of the ray to the final projected output list. So the best thing would be to call Intersection.RayShoot directly (check the attached file).

Attachments:

thanks djordje,

I can't use RhinoScript because the entire code has been write using rhinoscriptsyntax.

I tried the ShootRay method but It consider each planar surface as a plane. so it returns wrong intersection points. think I should try something else.

GM,

Did you want to say:
"I can't use RhinoCommon because the entire code has been written using rhinoscriptsyntax." ?

As I said, rs.ShootRay does call the Intersection.RayShoot method but unlike grasshopper's "Project point" component it adds the starting point of the ray too.

So if you do not want to use RhinoCommon methods, but rhinoscriptsyntax functions only, you could do it with a bit of work around: use the rs.ExtendCurve and rs.CurveBrepIntersect. Check the attached file.

Attachments:

yes, that's what I mean for 'something else'. thanks anyway

that's the problem I found using rs.shootray in my code

Attachments:

Join your box sides.

Check the attached file.

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service