Salusoft89 / planegcs

A webassembly wrapper for FreeCAD's 2D geometric solver.
https://www.npmjs.com/package/@salusoft89/planegcs
GNU Lesser General Public License v2.1
22 stars 7 forks source link

L2LAngle_LL when driving: false does not work for measurements #5

Closed angelobartolome closed 2 weeks ago

angelobartolome commented 2 months ago

Hello,

I'll write a POC code shortly, but when we create a line-to-line angle constraint using driving: false to get current angle measurement (as noted in documentation), the constraint (after solving) stays at 0, or whatever angle you entered at first.

You cannot provide undefined as initial angle when creating the constraint since GCS crashes.

Code when creating the constraint:

  const constraint = {
    type: "l2l_angle_ll",
    l1_id: lineA.id,
    l2_id: lineB.id,
    driving: false,
  } as Omit<L2LAngle_LL, "id">;

Picture proving you need to provide an initial angle

image

After adding an initial angle of 0:

image
thes01 commented 2 months ago

Hello, yes I'm sorry for this, I didn't realize I had forgotten to implement updating the nondriving constraints' parameters after solving. For now, I have updated the documentation and I should be able to implement it by the next week. Let me know if you'd be possibly interested in contributing yourself, I could give some advice ;)

angelobartolome commented 2 months ago

Hi @thes01 Nice, for sure I can help, I've been using this library quite a lot so I'll be happy to contribute to it.