Ordinamento loop NON riuscito - Sorting loop failed

When I try to make the hatch command on some curves , Rhino gives to me an error “Ordinamento loop non riuscito”.
The curves are closed and nested without points of contact. What happens? Who to solve this?
Thanks for supportErrorSortingLoop.3dm (1.6 MB)

Imported from AI ?
Problem is letter M, has many overlapping control points.
Clean/Delete unwanted points or better, redraw letter with PolyLine.

Not imported, is it create from CreateContourCurve command.
But why this error is reported? I have made a plugin that create some section slicing from solid to use with laser machine.

Hmm --> Unknown command: CreateContourCurve ?
No idea, can you upload original 3d modell from letter M,
3D modell was from surface or from mesh ?

The original is on the layer ‘temp’. I use this command
for (SliceStep = bbox.BoundingBox.Max.Z; SliceStep >= bbox.BoundingBox.Min.Z; SliceStep -= job.DepthMark)
{

                        SectionPlane.OriginZ = SliceStep;

                        if (elems[0].Geometry is Brep)
                             ListaCurve = **Rhino.Geometry.Brep.CreateContourCurves(elems[0].Geometry as Brep, SectionPlane);**
                        if (elems[0].Geometry is Mesh)
                            ListaCurve = Rhino.Geometry.Mesh.CreateContourCurves(elems[0].Geometry as Mesh, SectionPlane);

                        hatches = Rhino.Geometry.Hatch.Create(ListaCurve, 0, 0, 1);

It’s not the slicing that is the problem.
The object in this image is one single surface:


To get sharp corners on something like that, you need to stack the control points. In the image, you see 4 selected points towards the left of the shape. Thing is, those are not 4 but 12 points.

While Rhino lets you stack control points on top of each other, you might experience problems later on in the workflow. Using sections through this to use as input for hatches is one such problem.

And note that the problem with this most likely stems from the curve that was used to create this surface. How was that curve made? Why not just use simple straight lines to draw that letter?

I create a serie of slices from solid or polysurface or mesh using CreateContourCurve command (i use c# to do this), but on some slices like this one, when I apply the _Hatch command an error message appear.
How to solve this?

Well, … again:

Where does this particular solid or polysurface or mesh come from?

I don’t know is supplied by our customer. I think was modeled with RhinoGold or Matrix

The problem belongs more in Category Rhino Developer.
I bet in their array from mesh geometry are multiple points with same coordinates (duplicates)

May be, but anyone has some ideas how to solve this?

If the slices are polylines, you could get the list of vertex coordinates, eliminate the duplicate points, re-create the polyline without the duplicate vertices, and replace the original.

–Mitch

possibly this additional method can help
RhinoCommon Sdk Point3d.CullDuplicates

Oh, also, on the single creased surfaces surfaces that come in, you could simply run DivideAlongCreases, that should eliminate the problem by transforming the single surface into a polysurface. Then the slicing should not create stacked points… Probably the easiest thing to do in this case…

–Mitch

I have tested attached .rvb script on letter curve M and works without curve destruction.
Methods from RhinoScript:
MaxThreeKnotsOnU.rvb (891 Bytes)

Thank you
another thing: I cannot find this instruction on RhinoCommon library (i use c#). Do you know if is possible to use same on c#?

I have tried your plugin but nothing happens.
The duplicate point stay in curve

Yes, ControlPoints from Degree(3) stays on the same position, but my script deletes neighbour Knots(U) values and not CP and that is needed for Hatch
…unnecessary CP is also removed…and this results in a curve deviation

I’m sorry but at me don’t work. The curve has always 1 duplicate point and hatch is not performed

Same file from your first post, or other file ?