However, the spirals are straight for an entire lap around the mesh before “jumping up” to the next level so-to-speak. What I’m after is more of a smooth spiral following the mesh surface all the way from the bottom to the top.
Also, I would like the spirals to be unevenly distributed around the mesh. So that if I have a shape that is taller in one end (like the mesh in the screenshot above), there will be more distance between the spiraling lines in that end (see illustration). But how to achieve that?
Point3d p = box.GetCorners();
Point3d low = (p[0]+ p[1]+p[2]+p[3])/4.0;
Point3d high = (p[4]+ p[5]+p[6]+p[7])/4.0;
Line axis = new Line(low, high);
Make a spiral using this axis. Or make a “bending” spiral using a rail nurbs “based” on that axis (that’s tricky: for defining the “based” part of the story).
From each spiralPt get the closest to the axis (or nurbs) and define a line.
Compute the ccx (Mesh/Line): that’s the tricky part: If their count >1 … sort the ccx pts with respect their distance to the spiralPt and get the first. This solves multi ccx events that are due to some possible “folding” Mesh areas.
I’m in no means fluent in C#, but I know a little. Probably a lot less than you though
I was able to achieve something by intersecting several planes made with pufferfish (to achieve increasingly angled spirals) with the mesh. But the definition seems to work only when the “Number of Revolutions” and the “Resolution” of the intersections evens up in some odd way. If someone could take a look at the definition and explain to me why it works only in some cases (most often when the resolution is quite low it seems) i’d be very thankful!!!
“Forgot” to mention that this is unsolvable without a Physics Engine (but Daniel did the K2 thing [He forgot to provide any SDK … but nobody’s perfect]).
An indicative way to apply Flow Morph on some helix (To do: do a helix C#) using some bending Curve (To do: you know what).
The best way to cut the mustard prior 3.
The best way to cut the mustard … er … after 2.
I hear you: that’s paranoid, has paranoid options plus is complex and ultra sensitive to parameter values > what’s this freaky nonsense anyway? Well … that’s Physics Engine … where anything is possible (and/or impossible [Karma: a must]).
BTW: The big thing here is NOT the spiral (any spiral) … but what K2 can do on these ccx pts (while they are staying on the mesh). That said if you want to deal with folding mesh areas … then the Ray3d Method used here is not the proper way since IF it returns t >=0 (Point3d ccxPt = ray.PointAt(t)) … then we are talking about the first/closest pt (to ray’s fromPt) … but that’s trivial to manage via other ccx Methods. But is fast AND the face indices involved is a handy way to do something with them (if this is the final goal).
PS: Forgot to internalize the demo data, use this recycle the other:
NOTE: Mesh is auto triangulated. If you have quads and you want to work with them then you must sort the face indices/vertices (for obvious reasons). One way to do that is the classic MTV.SortEdges(MTVIndex) (plus some basic Lists ops taking into account MTV connectivity). The other (way simpler) is to sort by angle with regard the XAxis of a facePlane (faceCenter, faceNormal).