# Forum: Inkscape New LPE, New Video. Fillet/Chamfer

on 2014-05-12 15:27
Attachment: signature.asc (213 Bytes)
```Hi to all.
Here is a video showing my new LPE. The branch is here[1].The video
here[2].

Thanks to Josh Andler for give me the idea
Also thanks very much to suv for the feedback and time inverted on it.
And a special thanks to Liam P. White, without his help the LPE need a
lot of hours to be.. or not to be.

Bye, Jabiertxo.
on 2014-05-13 18:58
Attachment: signature.asc (230 Bytes)
```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

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.

> 1) 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.

> 2) 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.

> 3) 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.```
on 2014-05-14 14:17
Attachment: signature.asc (230 Bytes)
```Hi Nathan. I do a deeper look.

/////////////////////////////////////////////////////////////////////
El mar, 13-05-2014 a las 03:40 +1000, Nathan Hurst escribiÃ³:
1) 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.
/////////////////////////////////////////////////////////////////////

When I convert to paths a filleting the result curvature is a path of
one segment, start and end nodes of this are tangent to front-back
curves, and thsi sttart and end nodes are also handled as tangent for
the inkscape UI.

Maybe the problem is how far is the tangent handle from a node, but
there isn`t a perfect way to determine, it depends from case.
I use the nearest point to the tangent from a point placed at a half
distance from the real knot filleting to the original cusp node.

Here are some pics about how it works: http://sta.sh/28yrjqkdiw1

//////////////////////////////////////////////////////////////////////
2) 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).
>
///////////////////////////////////////////////////////////////////////

I see about it in power stroke code, I realy do the code but finaly
removed, think isnt interesting in one curve path, because it increase
the nuber of nodes of the resulting path because you need to pass the
cubic values of the handles as points, because the incoming and outgoing
curve need to be unchanged.

This is my opinion but if anybody want to tell me about, i could
change ;)

Thanks Nathan for the feedback.```
on 2014-05-14 17:43
```On Tue, May 13, 2014 at 12:12 PM, Jabiertxo Arraiza Cenoz <
jabier.arraiza@marker.es> wrote:

> When I convert to paths a filleting the result curvature is a path of
>
Is there any real benefit to the knots being offset from their origin vs
overlapping? Since by default, the fillet & chamfer knots are 10px (and
90degrees CCW) offset from their "origin", it is not very obvious what
they're connected to.

See the linked image (1) to see how this is massively confusing. The top
object has the knots offset to 0px and looks as expected, the bottom one
is
the default when the LPE is first applied. By default here, the green
knots
all correspond to nodes that they are fairly offset from. In this case
the
top-left node has a control knot that is overlapping the bottom-left
node.
The bottom-left node has a knot floating to the right of it. As a
default
this is really bad for usability imho.

One more suggestion (if possible) would be to add a field for "focused
knot" which contains the numerical value of the last dragged or clicked
knot. This would be nice to fine tune things for perfectionists without
forcing them into the xml editor.

(1) http://imgur.com/4Ga31GC

Cheers,
Josh```
on 2014-05-15 01:43
Attachment: signature.asc (230 Bytes)
```El mar, 13-05-2014 a las 15:38 -0700, Josh Andler escribiÃ³:
> The bottom-left node has a knot floating to the right of it. As a default
> this is really bad for usability imho.

Ok this ia a ugly problem. I solve putting the offset inside the same
segment instead 90degrees CCW. I dont want to put a initial value of 0
offset because it make unselectable the node, because a default knot
place over it.

> One more suggestion (if possible) would be to add a field for "focused
> knot" which contains the numerical value of the last dragged or clicked
> knot. This would be nice to fine tune things for perfectionists without
> forcing them into the xml editor.
>
> (1) http://imgur.com/4Ga31GC

You can change it numericaly selecting the node, checking apply to
selected nodes and change the radius, but you havent a visual value of
actual distances, so is planned a knot dialog on a event to full
configure it.
You can:
*Toogle fixed or relative
*Also toogle fillet or chamfer
*Numeric distance or porcentaje entry
This is enought?
Liam P. White use a similar dialog in his power stroke implementation
[1], i get the base code from him.

@LiamW Whats your opinion to change the knot dialog to a double click? I
want to use the same way than you but seems to me double click is
better. I have a diff if you want to allow double click event on knots.

Regards, Jabier.```
on 2014-05-15 02:49
Attachment: signature.asc (230 Bytes)
```> Ok this ia a ugly problem. I solve putting the offset inside the same
> segment instead 90degrees CCW. I dont want to put a initial value of 0
> offset because it make unselectable the node, because a default knot
> place over it.

Done in last revision, here are a screen shot:
http://sta.sh/0sfnq2flsfj
Nathan ordering my sta.sh broken the link to teh tangent pics, here are
new ones:
http://sta.sh/2cdmgppy65h

The branch is now in the inkscape.dev group so this is the new direction
to the branch:
on 2014-05-20 08:27
Attachment: signature.asc (230 Bytes)
```Hi Nathan, sorry for the late reply, Im waiting to have it to reply.
> Ok, the tangents do look correct.  I think the problem is that you
> need to find the osculating points on the curved path fillets.  There
> is a toy for this (called fillet-minion).  See if that makes for nicer
> fillets.

You are ok, oscilating point is wrong. I surf into the 2GEOM toy
filet-mignon, i do about but it give me the strange results pointed by
Cale Gibbard in the #3 of this launchpad bug
Finaly i adopted the Cale solution in the same bug

Soon I comit the new code. I have a extra problem related to time values
on curves, I find that not straight lines have his time values based by
his handles instead the distance along it. My cuestion is: Any way to
know a point at a distance based time value?

Sorry if not explain so well.
Regards, Jabier.```
on 2014-05-21 09:45
```well done ... nice forun

www.soran.edu.iq```