MoI discussion forum
MoI discussion forum

Full Version: Rebuild curve variation

From: archetype (FABIENF)
14 Aug 2018   [#1]
Hi all,

I am looking for a curve rebuild/reconstruct variation, capable of converting a curve into a polygon as shown below:



The current ReconstructCurve script allows the conversion into a polygon, however, the points will lie on the curve itself, as opposed to enclosing the original curve as above:



Does such a script exist? Or perhaps a modification of said script(s)?

Cheers,

Fabien
From: Michael Gibson
14 Aug 2018   [#2] In reply to [#1]
Hi Fabien, I'm not aware of anything that would do that. That's a significantly different type of result than the existing one so I doubt it would be feasible just by a modification to that existing script.

In your desired result, how is the spacing between points determined, are you looking for all the line segments to be of equal length? And you want to choose the number of lines?

What kind of result would you expect on that curve if you said make 3 lines for example?

- Michael
From: archetype (FABIENF)
14 Aug 2018   [#3] In reply to [#2]
Hi Michael,

The segments would not necessarily have equal length (although it might be a nice option to have available). I am most interested in an adaptive algorithm, where tight bends yield short segments and vice versa. Being able to choose the number of segments would be the way to go then.

Although I suspect that there's a certain threshold, in terms of minimum segments before falling back to another (green line in the example) algorithm or simply fail with a warning. I think three would be too low to represent such a curve at all, no?

Ideally, such a script would allow an offset value from the initial curve as well, although doing an offset manually afterwards would be fine.

It's a real-world use-case by the way, related to the stuff I've shown you recently.

Thanks,

Fabien
From: BurrMan
14 Aug 2018   [#4] In reply to [#3]
you could do that currently by using the save point file and import point file commands.

So, rebuild your curve to your point count (Or you already have the curve with point count)

Show the points and copy and past them, then save the point file.

Importing the point file gives the option to bring it in as a polyline.

Maybe a scriptor can combine all of this into a single, realtime command...
From: Michael Gibson
14 Aug 2018   [#5] In reply to [#3]
Hi Fabien, yes your desired result does look like the control polygon of a curve so try doing a regular curve rebuild and then extracting the control polygon like Burr writes above. Yours kind of looks more like a quadratic curve's control polygon so you might try doing a FitCrv in Rhino with Degree=2 and see if that's closer or not.

> I think three would be too low to represent such a curve at all, no?

Yes I think so but that can kind of indicate that what you're asking for is not very well defined as a specific algorithm. A script needs to follow some specific steps.

- Michael