Skip to content

Allow tangent on arcs/lines/splines without coincident endpoints.#1493

Merged
ruevs merged 2 commits intosolvespace:masterfrom
ruevs:tangent_diconnected
Nov 14, 2024
Merged

Allow tangent on arcs/lines/splines without coincident endpoints.#1493
ruevs merged 2 commits intosolvespace:masterfrom
ruevs:tangent_diconnected

Conversation

@ruevs
Copy link
Member

@ruevs ruevs commented Nov 6, 2024

…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
@phkahler
Copy link
Member

phkahler commented Nov 6, 2024

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?

@ruevs
Copy link
Member Author

ruevs commented Nov 6, 2024

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.

@ruevs ruevs force-pushed the tangent_diconnected branch from 7da1704 to a33d1b0 Compare November 7, 2024 09:07
@ruevs ruevs force-pushed the tangent_diconnected branch from a33d1b0 to d97b9be Compare November 7, 2024 10:21
@ruevs
Copy link
Member Author

ruevs commented Nov 10, 2024

@phkahler so? 2b|!2b ?

@phkahler
Copy link
Member

@phkahler so? 2b|!2b ?

I'm just going to trust your judgement on this one. The code looks reasonable ;-)

@ruevs ruevs merged commit d97b9be into solvespace:master Nov 14, 2024
@ruevs ruevs deleted the tangent_diconnected branch November 14, 2024 10:44
@ruevs
Copy link
Member Author

ruevs commented Nov 14, 2024

Merged then :-)

@phkahler
Copy link
Member

Merged then :-)

Thanks @ruevs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow tangents on curves/arcs/lines without coincident endpoints (Was: "Arc of circle tangential to line segment kind of works but is broken")

3 participants