MoI discussion forum
MoI discussion forum

Full Version: Offset + Rebuild as polyline interactively

Show messages: All  1-4  5-8

From: archetype (FABIENF)
23 Sep 2018   [#5] In reply to [#4]
Wow, thanks Michael! This will be very helpful! I've noticed that closed curves yield an open polyline right now - I haven't looked into closing it in the script yet, but I thought I'd mention it.

I take it that only the offset of the point is taken into account, not its relative position along the curve? In a perfect world, it would be also one of the points of the polyline generated ;)

Further simplification of the polyline based on a threshold angle is probably a lot more involved, too, I guess.

Thanks again for your help!

- Fabien
From: Michael Gibson
23 Sep 2018   [#6] In reply to [#5]
Hi Fabien, you're welcome!

> I've noticed that closed curves yield an open polyline right now - I haven't looked into
> closing it in the script yet, but I thought I'd mention it.

For that try looking at the .isClosed property on the curve and if true insert the start point at the end of the polyline inputs.


> I take it that only the offset of the point is taken into account, not its relative position along the
> curve? In a perfect world, it would be also one of the points of the polyline generated ;)

Sorry I'm not understanding this part. Which point are you referring to here?


> Further simplification of the polyline based on a threshold angle is probably a lot
> more involved, too, I guess.

Yes, kind of more involved but it should be doable if you want to try it. You would need to make some vectors between the points, use dotproduct to determine the cosine of the angle between them and figure out the logic for remaking the points skipping some I guess.

- Michael
From: archetype (FABIENF)
24 Sep 2018   [#7] In reply to [#6]
Hi Michael,

I'll add the closed curved functionality and post back the script here, thanks.

Regarding the point on polyline behavior, what I meant is that the picker does not let you place an actual point to be used as the starting point as well as the offset value. Currently, only the offset value is read, not the location of the point where it was clicked. If that would be possible, one could 'slide' along the original curve, and determine the place where the points are being distributed from. I'm not sure if that complicates things a lot, though.

I'll see if I can do some polygon reduction work as well ... thank you for the hints.

- Fabien
From: Michael Gibson
24 Sep 2018   [#8] In reply to [#7]
Hi Fabien,

> If that would be possible, one could 'slide' along the original curve, and determine the place
> where the points are being distributed from. I'm not sure if that complicates things a lot, though.

It sounds like that would need a totally different point distribution strategy. Right now it just makes evenly spaced points along the offset. From what you are describing here I'm not sure how that would work if for example your new point was close by the start point of an open curve. Would you want the start point of the curve to be ignored and not included in the polyline?

- Michael

Show messages: All  1-4  5-8