Hi Nathan.
Fantastic work, Jabiertxo!
Thanks very much
Something to think about: If you were writing the curve editing/handle code from scratch, how would it work?
Firts to the end: Not realy a code from scrach. it have a lot of code from Power Stroke, without this i couldent make this.
Power Stroke store in a vector of Geom::Point the data of his knots, basicaly in the X coordente store the position in the line and in the Y coordinate store the distance from knot to original line in perpendicular. Also have acallback in node tool for handle updates on the original path.
Whith this base i work the effect. The work in progres add new features to the original concept whith the feedback of suv, LiamW and ScislaC. I put the ended result:
I need to store: Distance from Knot to path: Stored in the [Y] part. it determine how far is the knot to the path -configurable by LPE widgets- in poxels, from 0 in the same path, in away. this is because with some zoom knots hide nearly Nodes and need a way to move a bit. It reply your 3 question
Hide or show knot: Knots only show in cusp nodes so [Y] negative values in symm nodes... make the knot invisible.
Fillet or Chamfer: It also is handled by the [Y] part of the Geom::Point. The [Y] value can be an floor(double) or a floor(double)+0.0001. In case there is decimal part, the effect show as chamfer.
If a knot radius is in mode flexible (green knot): Store in the X value of the pathvector (int)index_of_pathvector +(decimal)0.-1 point at this curve. the next curve radius is calculated by the phisical distande in previous.
If a knot radius is fixed (red knot): It still store the value in X but is stored in pixels -whith unit conversions- and with a negative value for easy check. This knots are exactly the X value in pixels*-1 in both sides.
- to my old astigmatic eyes the tangents do not look like they are
quite matched, are you sure you have the tangent code correct. This is especially noticable when you are filleting a curve rather than a line.
I look for more deeply.
- can you add fillets with smooth curvature variation (e.g. cornu
spiral, spiro, and I recall there being a 2geom toy that demonstrated something like that).
The same.
- I'm not exactly understanding the meaning of the green fillet
handle - the natural interpretation to me would be to have the green diamond at the transition point from the original path to the fillet, but yours seems to be offset somehow. Why?
Replied.
Thanks Nathan for the feedback. I send news soon whith the active points. Sorry for my english.
Regards, Jabier.