triplus wrote:What you implemented is curvature comb with bounding curve. Without this feature it would be really hard to inspect the curvature.
P.S. It makes perfect sense and thanks for adding the feature.
What I refer to is actually the conversion to NURBS. Those circle, arc of circle, ellipse, arc of ellipse, arc of hyperbola and arc of parabola that are now BSplines.
The problem is in needing to change the behavior of show internal unused geometry, because if constraints are enforced at showing the poles, the shapes loose the geometry.
However, after reading your reactions, well, I get that what has to be done is change the the show/restore to work like the other forms, and provide another mechanism for the autoconstraining of weights on creation.
yorik wrote:FreeCAD is getting the most gorgeous curve editor out there!
Probably not, but I gladly accept the compliment
emills2 wrote:SInce Werner mentioned combs external to the sketcher, just wanted to point out that Chris_G's macro, as written way back, could be assigned outside of the sketch, and still show during sketch editing. I haven't updated it since last august.
I guess this does require that the AutoUpdate function of the sketcher is active... so it would also update all other geometry using that sketch during edition... Not trying to defend one choice over the other. I have learned a long time ago that what seems right at a given moment turns to be a bad decision later on, just trying to fairly compare what you get from each.
Anyway, "external" from wmayer, at least in one option, is just hardlinking the algorithm, which would be exactly the same as it is today... when it will be available. I am all for such an option... when available.
emills2 wrote:The use case is to manually adjust the control points across a joint to maintain curvature flow:
if the combs touch at the end, you have G2 continuity
if the comb tangents are aligned, you have G3 continuity (more better)
The physical world impact is highlight flow: if you look at a modern car, the reflections have no 'breaks' in them. The tangents join, the curvature joins, and the derivative of curvature with respect to arclength joins.
Thanks for this interpretation of the comb. I did not know it and I find it enlightening.
emills2 wrote:This addition to sketcher looks awesome! Thanks Abdullah. I hope someone makes a windows build soon!
Welcome!! You may start using Linux in the meanwhile Just a joke. I am almost sure that when this goes to master, sgrogan will be more than happy to make one...
emills2 wrote:The upshot is that we will often want to raise degrees and insert knot into curves without changing the way they currently look.
Understood. I am trying to find a way to get into the knots without implementing De Boor and its differentials... while I sleep...
wmayer wrote:Some time for reflexion. Do you think such a conversion to NURB is useful? What do you think you could do with it?
This will be useful. I just have pushed a commit to master to convert an arbitrary curve to a B-Spline or NURBS. The default implementation of toNurbs does the same as toBSpline but for the conics it can be re-implemented to return a real NURBS.
Since we don't have a GUI tool to change the knot vector this would be a good way to bring a real NURBS of a circle into a sketch.
We really need to get better synchronised more often
This is what I did yesterday to produce that picture:
Code: Select all
int SketchObject::ConvertToNURB(int GeoId)
if (GeoId < 0 || GeoId > getHighestCurveIndex())
const Part::Geometry *geo = getGeometry(GeoId);
if(geo->getTypeId() == Part::GeomPoint::getClassTypeId())
const Part::GeomCurve *geo1 = static_cast<const Part::GeomCurve *>(geo);
Handle_Geom_Curve c = Handle_Geom_Curve::DownCast(geo1->handle());
Handle_Geom_BSplineCurve ncurve = GeomConvert::CurveToBSplineCurve(c);
Part::GeomBSplineCurve* bspline = new Part::GeomBSplineCurve(ncurve);
I like that you made it into Part:Geometry.
I selected GeomConvert because it is specific for the types we have in the Sketcher, but I did not know ShapeConstruct_Curve, which for the Sketcher geometries uses GeomConvert, so it is the same.
So now I will switch my code to use yours... well I learned GeomConvert exists