Open automata opened 10 years ago
Hand draw the OpenFit jeans shape on Toby's experiment. Using just angle constraints:
Using angle and distance constraints on curves. It seems to constraint better the original shape:
I think we should run OpenFit's processing sketch to feel the tool behavior while tweaking those parameters.
:smile: :thumbsup: Looks promising.
I'm imagining that the real tool will have measurements drawn as guides, then the pattern would be a geometric construction from those guides.
(Though I guess inseam and outseam are already 1:1 constraints.)
:jeans: :+1: for the measurements guides. Imagining a domain specific language or JSON to specify the patterns/measurements.
Running OpenFit's ByTheBook sketch:
Prototyping a tool based on spring simulation.
Now let's map the desired variables on these points...
Maybe the UI could work something like:
This might diverge from the by the book algos. If the polyline distances match body curve measurements, and there are a few soft polygons, it will fit. In theory.
Thigh and knee measurement constraints might help doing it this way. It becomes more of a mesh.
@electronicwhisper's description of a simple physics-based constraint solver:
- For each constraint
- For each point involved in the constraint
- Find where the point would need to be moved in order to satisfy the constraint (for example, to satisfy a distance constraint, move the point further or closer to the other point)
- Instead of moving the point directly to that spot to solve the constraint, just move it part of the way there (to simulate a continuously evolving system)
Do that iteratively and it seems to work pretty well.
Another take on my visualization:
(The vertex farthest to the right, back crotch, will be closer to 90° with the curve. Out of curiosity, I found how to calc the length of a bezier curve. Constraining to that distance seems crazy, so we should approximate the curve with a few segments. You can always sew a curved line.)
Thinking about a mesh-like system:
# measurements
outseam = 103
inseam = 88
waistC = 91
buttC = 102
thighC = 61
kneeC = 44
ankleC = 30
backMid = 41
frontMid = 31
# distances
ABCDEF = MNOPQR = outseam
GHI = STI = inseam
UVWI = frontMid
IJKL = backMid
AUMLA = waistC
CVOKC = buttC
# these would need more points, since ID != DI
DID = PIP = thighC
EHE = QTQ = kneeC
FGF = RSR = ankleC
ABCDEF
would make a polyline constraint AB+BC+CD+DE+EF
. The distances of each segment could be found by the ratio of the distances in the base drawing. The angles could be found by spring-like (energy minimization) constraint, weighted to the base drawing.
Thinking about this mesh-like system, when we get the actual #5 3d scan of a person can we just measure the seams along the 3D surface, then flatten from there?
Nice! And to mesh generation we can use constrained Delaunay triangulation or Chew's method.
Constrained Delaunay triangulation in JS: https://github.com/r3mi/poly2tri.js
I updated the pants model with dat.gui, now its actually a little ugly, but its important to note that I need to think in a new object to our model!
Sutherland's Sketchpad in the browser (about time somebody did that!): http://www.cdglabs.org/sketchpad14/demo/demos.html
Based on tips by @forresto: