Allow tangent on arcs/lines/splines without coincident endpoints.#1493
Allow tangent on arcs/lines/splines without coincident endpoints.#1493ruevs merged 2 commits intosolvespace:masterfrom
Conversation
…edge The functions Constraint:: ConstrainArcLineTangent ConstrainCubicLineTangent ConstrainCurveCurveTangent were introduced in 96958f4 in order to properly paste arcs tangent to other objects when mirrored. See the original pull request for details solvespace#833 and test files. However these functions use the original logic in constraint.cpp that relies on the two entities sharing an end point. This will interfere implementing tangents on entities without coincident points so I changed the logic to remove the dependency. As a side benefit it makes it cleaner and it's intent more obvious. See solvespace#937
|
Does this require you to select the end point of the arc? I would hope to automatically figure that out if it's constrained to the line. It's not too hard to search the constraints to figure it out? |
|
It does require one to select the end point(s) of the curve(s) at which the tangency constraint will be applied. I tried to make the error messages as informative as possible - take a look or play with it. If an arc/spline already has one point constrained on the line (not on it's end point) it does seem logical to automatically select that point, but it is not the only way - the other end of the curve can be constrained tangent. Auto selecting would constrain the generality of the solution, so I did not attempt to do it. Of cource if one explicitly selected a (the other) point we could override the automatic selection, but I think it becomes confusing. |
7da1704 to
a33d1b0
Compare
a33d1b0 to
d97b9be
Compare
|
@phkahler so? 2b|!2b ? |
I'm just going to trust your judgement on this one. The code looks reasonable ;-) |
|
Merged then :-) |
Thanks @ruevs! |
Implements #937
Test cases:
ArcsLinesSplinesTangentTests.zip
#833 (comment)
#833 (comment)
Cross references:
#833
96958f4
#937
#948
8c101d5
#951
#1492