Grasshopper

algorithmic modeling for Rhino

Hello,

I'm offsetting polylines in GHPython using rhinoscriptsyntax. rs.OffsetCurve seems to create extra points on the offsets, which is interfering with the rest of my script's logic.

I tried using SimplifyCurve to delete the extra points but that too behaves differently than the Rhino command.

Is there a workaround, or am I missing something?

Also, my script seems pretty long and clunky for such a simple task, is there a more efficient solution?

Thanks,

Max

Views: 2353

Attachments:

Replies to This Discussion

I think that you are not using Simplify properly.

Here is the solution using Rhino.Geometry instead of rhinoscriptsyntax function:

from Rhino.Geometry import Curve as c
from Rhino.Geometry import CurveOffsetCornerStyle as ce
from Rhino.Geometry import CurveSimplifyOptions as cs

a = []

for i in range(it):

oCrv = crv.Offset(P,dist*(i+1),0.01,ce.Sharp)[0]
a.append(oCrv.Simplify(cs.All,0.01,0.1))

Attachments:

Hi Max, hi Angel,

you were unlucky enough to discover two bugs (RH-31854 and RH-31855). They are not correlated.
The one with rs.Offset() is fixed in Rhino WIP, as Angel probably noticed.

I am attaching a definition that will work in Rhino, where Simplify() is called in RhinoCommon with finely-tuned arguments.

Thanks for reporting this,

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Attachments:

But, why did you use such a long CurveSimplifyOptions call instead of a simpler one like:

Rhino.Geometry.Curve.Simplify(offset_crv, Rhino.Geometry.CurveSimplifyOptions.All, 0.01, 0.001)

This worked for me in RH5 SR12 64-bit right now.

Well I did not want the arc simplification nor the G1 adjustment. Arc can take precedence over lines if the arc falls within tolerance.

Hi, thanks for your quick responses.

Your workarounds work, although there is still some unexpected behavior:

In my particular case it'll do just fine though, thanks!

Max

Yes, sorry, for now what I gave you, really, is just a workaround. Grasshopper gives the same result. It's really the RhinoCommon Offset() call that works not ideally.

Thanks for the extra reminder. It would help if you could attach the sample.

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Sure, here it is. (I used your definition as it was.)

Cheers,

Max

Attachments:

Thank you. This is fixed in the current Rhino WIP. If you need access, please let me know.

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service