Grasshopper

algorithmic modeling for Rhino

Hi everybody,

I'm having a problem offsetting a polyline: when the offset segments form convex corners, new corner points are created and I can't find a way to eliminate them.

Note: I can't use simpify curve because that will also eliminate other points I need that might be on a flat segment.

 

Attached follows a simple example definition + 3dm.

Thanks a lot!

Regards,

LUCAS

Views: 6789

Attachments:

Replies to This Discussion

Slightly improved version which corrects the parameters of the points on the flat segments.

Expect some bugs.

(Notice: you circled a point which shouldnt be eliminated)

Attachments:

Hi Systemig!

Thanks, your definition is beautiful and could work!

But... I saw it creates an unnecessary amount of data on several branches, with lots of duplicate points and polylines.

For the polylines, no problem, I can isolate the first item of the branches, using param viewer to cull the duplicates.

With the points the story is different: I couldn't find a culling pattern, the points are all over the tree. And then there should be a way to sort them so that they correspond to the original ones.

Wouldn't it be possible to flatten the point's data tree and then sort them according to the curve they're on, eliminate duplicates and then re-create the tree?

And yes, you're right, there's a circled point that shouldn't be. That was just to see if anybody was paying attention... :P

Attached follows my file. I've only added the last part.

Thanks a lot, again!

Regards,

LUCAS

Attachments:

Tell me if this works better.

I gave up with exploded segments parameters, the points parameters just refer to the global offset and simplified poly.

Bugs may appear with high offset values.

(By the way, this method is very similar to Pieter's one)

Attachments:
Hi Lucas, I tried something too, or should I say two somethings. Still, they only work on one curve.
Attachments:

Hi Pieter!

Thanks, but as I could see I lose the intermediate points on the flat segments, or am I wrong? I need to keep them.

Regards,

LUCAS

? Look again lucas. The first def finds the closest 'intermediate' Pts on the offset curve, the second def recreates them by their t-value (from each corner to corner segment).
Where do you want these non-corner points to go?

Hi again Pieter!

Well, with the definition you sent I either get a clean polyline or a polyline with random intermediate points on it, that change according to the distance.

I need these non-corner points to remain where they were on the original curve, obviously relatevely projected onto the offset curve.

My objective is to have an offset curve with the exact same number of points as in the original.

It's preetty much like an offset done in AutoCAD, if you're familiar with it you can see that convex corners don't create new breaks on the polyline.

Regards,

L

I'm not familiar with autocad...

I don't think my defs could result in clean polylines if you do not input a clean polyline (I added my printscreen).

The first def finds the 'intermediate' closest pts on the offset curve. N.B. that if the offset amount is higher than the minimal distance from a corner to a 'intermediate' pt, this 'intermediate' goes wrong.

The second def creates a clean polyline of the original, explodes it, determins at what t-value the 'intermediate' pts are on the linear segments. Then the offset curve is exploded and the 'intermediate' pts are translated to it (by their t-value). Then all the (17 in your curve) pts are sorted and create a polyline, which is less clean than it looks. You can see this if you attach a controlpolygon comp to the resulting offset curves. (or bake the offset curves and press F10 in Rhino)

Attachments:

Hello there again, Pieter!

I really can't understand... Maybe I'm doing something wrong? Your definition and everything you said make sense, but here it's simly not working... The first definition gives me no output at all, and the second gives me a clean polyline with lots of points stacked together on the discontinuities...

Here is a print screen, and attached follows the files (the ghx is the exact same as yours)

Thanks again!

Regards,

LUCAS

Attachments:
I don't get why the discontinuities level 3 aren't working here...
Does this definition work for you?
Attachments:

Hey Pieter, you had a difference between level 3 and level 2 discontinuities ? I couldnt see any difference on 8.10 and rhino 5 eval, or is it document tolerance related ?

Yes I did have a difference, try the first curve/file Lucas uploaded...
Tolerance is declared in the Rhino file, so I don't think that matters.
Here's how it looks at my pc...
Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service