Sketcher: Bezier curves
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Sketcher: Bezier curves
Alex, Agryson, has delivered those beautiful icons for the BSpline bar. I had some unpublished code and decided to cherry pick the commits and rebase in order not to break the unpublished code and the developments thereof to come into meaningless commits, so I cherry picked his commits. This is how it looks like:
Thanks Alex!!!
Thanks Alex!!!
Re: Sketcher: Bezier curves
Several improvements today. I created python counterparts of the ConverttoNurbs and IncreaseDegree SketchObject functions and made use of them to execute the commands, so now we have redo/undo functionality on these commands.
Missing parts for this deliverable:
The Convert to NURBS fails miserably by crashing when constraints where applied on the geometry to convert (slot). I have to take a look on what exactly happens, and maybe remove the constraints, if existing, before effecting the conversion...
The branch is updated for those who like to play:
https://github.com/abdullahtahiriyo/Fre ... iverable_2
Missing parts for this deliverable:
The Convert to NURBS fails miserably by crashing when constraints where applied on the geometry to convert (slot). I have to take a look on what exactly happens, and maybe remove the constraints, if existing, before effecting the conversion...
The branch is updated for those who like to play:
https://github.com/abdullahtahiriyo/Fre ... iverable_2
Re: Sketcher: Bezier curves
That would be @looo.abdullah wrote:Thanks! Good to know. You may want to report the issue to the one doing the python3 integration...
P.S. I'll compile and do some tests tomorrow. Especially as i haven't tested the curvature combs functionality just yet. But to be honest i thought you would merge the spline curvature combs functionality as is. As it looks finished.
Re: Sketcher: Bezier curves
I did not knowtriplus wrote:That would be @looo.
I intended to do the pull request, but I keep finding new use cases and small bugs.triplus wrote: P.S. I'll compile and do some tests tomorrow. Especially as i haven't tested the curvature combs functionality just yet. But to be honest i thought you would merge the spline curvature combs functionality as is. As it looks finished.
For example, now I thought I would like to have a NURB-izer that works differently, i.e. not substituting the shape with the new one, which is handy in other situations, but just by adding the approximation. The latter should work with external geometry...
Re: Sketcher: Bezier curves
When creating the internal geometries of a rational B-spline then due to the equality constraint all radii are equal.I intended to do the pull request, but I keep finding new use cases and small bugs
Re: Sketcher: Bezier curves
The main reason i asked is i have FreeCAD 0.17 build against OCC 7+ and i want to test 2 things when it comes to curvature combs. And i have your branch build against OCE 0.17 and i could test only 1 thing. Therefore this time i decided i will wait for the curvature combs functionality to be upstreamed and do both test after!abdullah wrote:I intended to do the pull request, but I keep finding new use cases and small bugs.
For example, now I thought I would like to have a NURB-izer that works differently, i.e. not substituting the shape with the new one, which is handy in other situations, but just by adding the approximation. The latter should work with external geometry...
Re: Sketcher: Bezier curves
Well, I think it is ready:
https://github.com/FreeCAD/FreeCAD/pull/538
Lately I have been working on small details and some functionality has changed:
- No constraint is enforce on restoring internal geometry (same functionality as for other complex geometries like ellipse).
- to NURBS works also on external geometry now (a new regular geometry with the approximation is added)
Let me hear your feedback
https://github.com/FreeCAD/FreeCAD/pull/538
Lately I have been working on small details and some functionality has changed:
- No constraint is enforce on restoring internal geometry (same functionality as for other complex geometries like ellipse).
- to NURBS works also on external geometry now (a new regular geometry with the approximation is added)
Let me hear your feedback
Re: Sketcher: Bezier curves
While this deliverable gets merged, I am looking for ideas to define the functionalities of the third deliverable. So here I look for some user input.
I have been doing a design with BSplines. I have identified some problems and I am looking for solutions:
1. When working you add a number of poles, it is not strange that this number happens to be too small or too high. Then you have to delete your B-Spline and make a new one with an appropriate number.
Possible solutions:
a) A tool to delete one pole.
b) A tool to split a bspline in two at a given pole
c) A tool to join bsplines (how? what if different degrees)
d) A tool that given a bspline approximates the Bspline using a "lower degree" or "lower amount of poles".
2. It is a nightmare to lock these beasts.
Any idea?
Separately:
3. What are you missing? (other than knots, knots are the next stage)
I have been doing a design with BSplines. I have identified some problems and I am looking for solutions:
1. When working you add a number of poles, it is not strange that this number happens to be too small or too high. Then you have to delete your B-Spline and make a new one with an appropriate number.
Possible solutions:
a) A tool to delete one pole.
b) A tool to split a bspline in two at a given pole
c) A tool to join bsplines (how? what if different degrees)
d) A tool that given a bspline approximates the Bspline using a "lower degree" or "lower amount of poles".
2. It is a nightmare to lock these beasts.
Any idea?
Separately:
3. What are you missing? (other than knots, knots are the next stage)
Re: Sketcher: Bezier curves
Hello Abdullah,
Your option a) is what I would expect as an end user.
But IMHO your list is missing an option: adding a pole to an existing B-spline. I'm not sure if it would be possible to insert a pole between two existing ones? Either
I don't see b) c) and d) as alternatives, but as additional tools that could each have their purpose. But IMO they would be lower priority than add/remove pole tools.
Talking about the nameless commercial CAD program I always mention, in its Sketcher the lock constraint acts differently than in FreeCAD. Rather than adding vertical and horizontal distance constraints from a vertex to the sketch origin, it literally locks/freezes the geometry in place. If a vertex is selected, then this point is locked in place and cannot be moved; if a segment (line, arc, circle, segment of a rectangle) is selected when creating the lock constraint, then the segment itself is locked/frozen. I wonder if the latter behaviour could be added to the existing lock constraint as an alternative to locking a vertex. It could apply to any type of segment... But maybe that would be opening a whole can of worms?
Have you looked at the Draft BSpline? The Draft Modifying toolbar includes add point and delete point tools. Their use is pretty user-friendly. In this case since the Draft BSpline is created from knots on the curve, you click on an existing knot to delete it, or you click somewhere along the curve to add a knot there.abdullah wrote:Possible solutions:
a) A tool to delete one pole.
Your option a) is what I would expect as an end user.
But IMHO your list is missing an option: adding a pole to an existing B-spline. I'm not sure if it would be possible to insert a pole between two existing ones? Either
- with the tool active, the user clicks on the B-spline and a pole is added in the area (trying to keep the resulting curve as close to the original as possible?), or
- the user selects two poles and a new pole is added between them. (might be more in line with the traditional Sketcher work flow)
I don't see b) c) and d) as alternatives, but as additional tools that could each have their purpose. But IMO they would be lower priority than add/remove pole tools.
Might this tool also allow the reverse, that is raise the degree/raise amount of poles?abdullah wrote:d) A tool that given a bspline approximates the Bspline using a "lower degree" or "lower amount of poles".
I think the nature of a sketch solver makes this unavoidable. It is the same problem I've seen in the commercial CAD software I use at work. Which is why most of the time, I don't follow my own advice where B-splines are concerned, and I leave them unconstrained.abdullah wrote:2. It is a nightmare to lock these beasts.
Talking about the nameless commercial CAD program I always mention, in its Sketcher the lock constraint acts differently than in FreeCAD. Rather than adding vertical and horizontal distance constraints from a vertex to the sketch origin, it literally locks/freezes the geometry in place. If a vertex is selected, then this point is locked in place and cannot be moved; if a segment (line, arc, circle, segment of a rectangle) is selected when creating the lock constraint, then the segment itself is locked/frozen. I wonder if the latter behaviour could be added to the existing lock constraint as an alternative to locking a vertex. It could apply to any type of segment... But maybe that would be opening a whole can of worms?
Re: Sketcher: Bezier curves
Sorry for asking, keep in mind I have no knowledge of the math behind B-splines, and no amount of links to technical papers will make me understand it.abdullah wrote:3. What are you missing? (other than knots, knots are the next stage)
To my question: what would knots bring to the B-spline? What can knots do that control poles can't?