GabiThume / open-fashion

Open Fashion Design Tool
7 stars 1 forks source link

implement openfit shape using springs simulation #1

Open automata opened 10 years ago

automata commented 10 years ago

Based on tips by @forresto:

openfit shape

automata commented 10 years ago

Hand draw the OpenFit jeans shape on Toby's experiment. Using just angle constraints:

openfit_angle

Using angle and distance constraints on curves. It seems to constraint better the original shape:

openfit_distance

I think we should run OpenFit's processing sketch to feel the tool behavior while tweaking those parameters.

forresto commented 10 years ago

: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.)

automata commented 10 years ago

:jeans: :+1: for the measurements guides. Imagining a domain specific language or JSON to specify the patterns/measurements.

automata commented 10 years ago

Running OpenFit's ByTheBook sketch:

openfit_bythebook

automata commented 10 years ago

Prototyping a tool based on spring simulation.

spring2

Now let's map the desired variables on these points...

forresto commented 10 years ago

Maybe the UI could work something like:

  1. Draw a polygon without constraints, moving points around until it looks close.
  2. Make groups of points that will eventually be the measurements.
  3. Define the base measurement for one of these polylines, which defines the scale for the rest.
  4. Move the points around until the other measurements are right for the base pattern.
  5. Weight the measurement polyline segments distance/angle by the original ratio.

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.

forresto commented 10 years ago

@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.

forresto commented 10 years ago

Another take on my visualization:

constraints on pants leg 2

(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.)

forresto commented 10 years ago

Thinking about a mesh-like system:

constraints on pants leg mesh 1

# 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?

automata commented 10 years ago

Nice! And to mesh generation we can use constrained Delaunay triangulation or Chew's method.

automata commented 10 years ago

Constrained Delaunay triangulation in JS: https://github.com/r3mi/poly2tri.js

GabiThume commented 10 years ago

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!

http://gabithume.github.io/open-fashion/spring/pants.html

forresto commented 9 years ago

Sutherland's Sketchpad in the browser (about time somebody did that!): http://www.cdglabs.org/sketchpad14/demo/demos.html