How can surfaces be converted to curves?

Hello,

my script currently looks like that:

I would like to have curves from the surfaces that I can then export. How can this be done?

In addition, it would be very helpful if someone could show me how to get letters from specific fonts into OpenNest and get the results as curves. I tried it like this:


test.gh (8.4 KB)

I would be very thankful for help.

You didn’t post code for your first image. In general though, Brep Edges and Join Curves does the trick.

As to the second image, Text needs an ‘L’ (Location) plane.

I don’t think OpenNest wants circular ‘Sheets’.

  1. System.NullReferenceException: Object reference not set to an instance of an object.
    at OpenNestLib.OpenNestUtil.ToPolyline(Curve curve, Boolean collapseShortSegments)
    at OpenNestLib.OpenNestUtil.ToPolylines(IEnumerable`1 nurbsCurves, Boolean collapseShortSegments)
    at OpenNest.OpenNestFullComponentCleanUp.SolveInstance(IGH_DataAccess DA)

This works perfectly, thank you!

What if we use a rectangle? How can it be done then?

Yes. It solves that problem but there is more. Holes are a problem for OpenNest. I’ve tried to remember how to deal with that (purple group) but it seems cumbersome. OpenNest works with curves, not surfaces, so what you see is the Boundary component. But there is still more…

As you can see, OpenNest doesn’t associate the two parts of the dotted “i”, they are nested separately. I’m not sure what to do about that. :thinking: Later: having given it some consideration, I can just barely imagine a solution but it’s elaborate, complicated and likely fragile so I’ll leave it for someone else. @Petras1 ? How does one nest “i” and “j” text?


OpenNest_2023Mar6a.gh (16.6 KB)

1 Like

When all else fails, stop! Step away from the keyboard and do something else.


OpenNest_2023Mar6b.gh (12.1 KB)

Though all this gets from OpenNest is the bounding box…

Very cool, thank you!


OpenNest_2023Mar6a_.gh (19.8 KB)

You need to convert curves to polylines then pass it as a boundary surface.

1 Like

Very peculiar that OpenNest is happy with holed boundary surfaces only if they are created with polylines? It doesn’t address the issue of keeping the dotted “i” parts together.

Here is a step in that direction. The cyan group is only for reference.


OpenNest_2023Mar7a.gh (16.2 KB)

This thread title should include the word “OpenNest”, eh?

1 Like

Looks great, thank you!

I was also wondering if it’s possible to give the letters a random size within a certain range and came up with this:


opennesttest.gh (11.3 KB)

Unfortunately, it doesn’t work well yet. The R always stays the same size, and changing the number of steps changes the word. Actually, a random command is also missing. Do you have an idea how to improve this?

That’s the problem, eh?


OpenNest_2023Mar18a.gh (17.5 KB)

1 Like

It works, thank you!