solvespace/test/constraint/pt_on_line
EvilSpirit cc07058e48 Rewrite equations generated for pt-on-line constraints.
Before this commit, pt-on-line constraints are buggy. To reproduce,
extrude a circle, then add a datum point and constrain it to the
axis of the circle, then move it. The cylinder will collapse.

To quote Jonathan:

> On investigation, I (a) confirm that the problem is
> the unconstrained extrusion depth going to zero, and (b) retract
> my earlier statement blaming extrude and other similar non-entity
> parameter treatment for this problem; you can easily reproduce it
> with a point in 3d constrained to lie on any line whose length
> is free.
>
> PT_ON_LINE is written using VectorsParallel, for no obvious reason.
> Rewriting that constraint to work on two projected distances (using
> any two basis vectors perpendicular to the line) should fix that
> problem, since replacing the "point on line in 3d" constraint with
> two "point on line in 2d" constraints works. That still has
> the hairy ball problem of choosing the basis vectors, which you
> can't do with a continuous function; you'd need Vector::Normal()
> or equivalent.
>
> You could write three equations and make the constraint itself
> introduce one new parameter for t. I don't know how well that
> would work numerically, but it would avoid the hairy ball problem,
> perhaps elegant at the cost of speed.

Indeed, this commit implements the latter solution: it introduces
an additional free parameter. The point being coincident with
the start of the line corresponds to the parameter being zero, and
point being coincident with the end corresponds to one).

In effect, instead of constraining two of three degrees of freedom
(for which the equations do not exist because of the hairy ball
theorem), it constrains three and adds one more.
2016-11-26 19:35:38 +00:00
..
free_in_3d_v20.slvs Add tests to cover 95.3% of constrainteq.cpp branches. 2016-08-07 17:33:27 +00:00
free_in_3d_v22.slvs tests: bulk add of migrate_from_v22 tests. 2016-11-02 02:33:31 +00:00
left_free_in_3d.png Fix rendering of reference axes in bottom left corner. 2016-10-11 23:32:21 +00:00
left_free_in_3d.slvs Rewrite equations generated for pt-on-line constraints. 2016-11-26 19:35:38 +00:00
normal.png Fix rendering of reference axes in bottom left corner. 2016-10-11 23:32:21 +00:00
normal.slvs Rewrite equations generated for pt-on-line constraints. 2016-11-26 19:35:38 +00:00
normal_v20.slvs Add basic test coverage for curve sketching tools. 2016-08-01 11:31:38 +00:00
normal_v22.slvs tests: bulk add of migrate_from_v22 tests. 2016-11-02 02:33:31 +00:00
right_free_in_3d.png Fix rendering of reference axes in bottom left corner. 2016-10-11 23:32:21 +00:00
right_free_in_3d.slvs Rewrite equations generated for pt-on-line constraints. 2016-11-26 19:35:38 +00:00
test.cpp tests: remove CHECK_RENDER from migrate_from_v* tests. 2016-11-02 02:40:17 +00:00