I have 02 3D curves that are the bottom reference of the road.
I want to define a flat slab below the road. The slab must to put right angle to keep the thickness of variable part as small as possible and the max distance as minimum as possible.
What I did:
I’m trying to find the plane that the total distances from the curve to the plane as small as possible. (the plane can not cut the curves).
I used Galapagos to optimize the total distance. (see the GH file). Findplane.gh (25.9 KB)
Each time I run, I find a new plane that is not fit with the old plane. (sometime it can not finish the test. )
Look, there was an error in version ‘b’ above, due to the difference in scale of the two models.
Fixed below. The Plane Fit ‘dx’ (deviation) is only 15.58 units (millimeters?). You can move the plane that far down if you must. The fact is though that your curves are not co-planar.
I have no way to determine which is the “better” Plane Fit result? Regardless, note that I projected the control points to the plane and created co-planar interpolated curves (IntCrv) before lofting to make the planar surface.
P.S. Using curve division points (10 per curve) for Plane Fit instead of end points or control points, the deviation is 86.0 units.
In retrospect, I realized that projecting control points and interpolating them wasn’t a good idea, so I looked at this again.
First, I had to deal with the extreme unresponsiveness of GH/Rhino, which made it too difficult to modify the model. I added a switch between “In Place” and “Move to XY”, which moves both curves to the ‘World XY’ origin. This fixes the poor responsiveness issue!
Later, I discovered accidentally that this revised model works well “In Place” as long as certain kinds of geometry are avoided. For example, there is a disabled “SLAB” group with a big warning to “Use ‘Move to XY’ feature before enabling”.
Otherwise, I added some features and options to visualize the true shape of your curves relative to a ‘World XY’ plane with its origin at the lowest end point (white ‘X’).
‘Plane Fit’ origin is adjusted automatically to the lowest position to avoid being above any of the points. The blueish surface below uses the original curves and is definitely not planar! The light green surface is planar, derived from projecting your curves to the adjusted ‘Plane Fit’. But is that really what you want? It appears to deviate from the original surface by up to ~220 units (millimeters? 8 inches?).