Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add point on line segment constraint #422

Open
Harvie opened this issue May 22, 2019 · 9 comments
Open

Add point on line segment constraint #422

Harvie opened this issue May 22, 2019 · 9 comments

Comments

@Harvie
Copy link

Harvie commented May 22, 2019

When i set constraint for point to stay on line, it can move past the two points defining the line like this:

image

I think it would be usefull to have constraint that can limit point movement only between these two points, eg.:

image

Can you please add this?

@Harvie Harvie changed the title Add point on line segment Add point on line segment constraint May 22, 2019
@Evil-Spirit
Copy link
Collaborator

This will be able with ranged constraints merged. PointOnLine has param and it can be constrained to be 0..1.

@whitequark whitequark added this to the 3.0 milestone May 24, 2019
@phkahler
Copy link
Member

Can this be applied to point-on-spline then?

@whitequark
Copy link
Contributor

@phkahler I think the problem is the discontiguity between two parts of a spline.

@Evil-Spirit
Copy link
Collaborator

Evil-Spirit commented Jul 17, 2019

There is no problem to make pt-on-spline if spline is split on cubic bezier segments, but in case of SolveSpace where we have one primitive for several splines (up to 15 pts) we should invent some special derivative-function made of segments. My suggestion is to remove the current spline entity and substitute it with

  1. Cubic spline made of 4 pts
  2. Tangent constraint of second order derivative

So, we can support old files in the way where we substitute one big spline with small ones and applying special (G2/C2 derivatives smooth) tangency after loading.

Look at NoteCAD where we have pt-to-spline and even pt-to-arbitrary function, but still have no tangent of second derivative (temporary)

@phkahler
Copy link
Member

I was only thinking of the cubic spline with 4 points. I had forgotten that those are created with the same tool as the many-point splines and may be considered "the same thing" when they're actually sort-of different. I know the more complex version is actually composed of many instances of the simple version internally, but it still begs the question of how to transition a constrained point from one segment to the next. It wouldn't seem right to allow it for one curve and not another when they are created with the same tool.

I'd recommend doing point-on-line-segment first. Then the code will be in place to limit the range of parameters (Revolve angle may want that too).

@Evil-Spirit
Copy link
Collaborator

@phkahler it is already implemented and needs some UI/cosmetic fixes Evil-Spirit@7cb2b8f

@Thovthe
Copy link

Thovthe commented Apr 15, 2022

3.2 milestone? Is this behaviour toggleable?

@ruevs ruevs added this to the 4.0 milestone Apr 15, 2022
@ruevs
Copy link
Member

ruevs commented Apr 15, 2022

Maybe 4.0 together with #77 .

@ruevs ruevs mentioned this issue Jun 11, 2022
@liuxilu
Copy link
Contributor

liuxilu commented Jun 1, 2023

Workaround: A chord is always <= the diameter.

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

No branches or pull requests

7 participants