"Outset/inset path" act erratically if input path is small

Bug #616469 reported by Bernd Bandemer
44
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
Peter Mora

Bug Description

Path->Outset and Path->Inset work as desired if the input path is big enough. When the input path is small, then the modified path will have seemingly random rounded corners and the shape will in general not match that of the original path. What is "small" depends on the amount of outset specified in Preferences->Steps->"Inset/Outset by". As a rule of thumb, if the path diameter is 15 times or less than the desired outset, the error happens.

The error does not affect Path->"Dynamic offset" or Path->"Linked offset", which both work as desired.

Steps to reproduce:
- Open a new drawing
- Set Preferences -> Steps -> "Inset/Outset by" to 1.0px
- Draw a 15px times 15px rectangle
- Run "Path->Outset" or "Path->Inset" on it

This is Inkscape 0.47 on Ubuntu 10.04 LTS, but the same bug exists in Inkscape 0.47 on MacOS 10.6.

PS: Inkscape is great! I use it for all my academic work.

Revision history for this message
Bernd Bandemer (bandemer) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Reproduced with Inkscape 0.48+devel r9701 on OS X 10.5.8

Changed in inkscape:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Pander (pander) wrote :

Perhaps one should optionally be able to specify a percentage for outset/inset step size.

Is this bug related to https://bugs.launchpad.net/inkscape/+bug/180708 ?

Revision history for this message
jazzynico (jazzynico) wrote :

Still present with Inkscape trunk revision 12010 on Windows XP.

Changed in inkscape:
status: Confirmed → Triaged
Revision history for this message
su_v (suv-lp) wrote :

Still present with Inkscape 0.91+devel r14159 (on OS X 10.7.5).

Revision history for this message
Peter Mora (morapeter) wrote :

Still present with 0.92 (on linux). It's an annoying bug, and limits me from using Inkscape for preprocessing laser cutting tasks.

I started to debug this, and everything works correctly if I remove "res->Simplify(1.0)" in "sp_selected_path_do_offset" function. I understand neither the MakeOffset's logic, nor Simplify's logic. I'll dig deeper.

 Peter

Revision history for this message
Peter Mora (morapeter) wrote :

I have two proposals:

1. Remove the "Simplify" call completely from Inset/Outset commands. (You can call it manually with Ctrl+L anyway.)
2. Call "Simplify" with "simplifythreshold" value (instead of capping it with an arbitrary 1.0). We might need to adjust it with "size" just as in "sp_selected_path_simplify_item" function. This way the Inset/Outset command would be just the pure Inset/Outset function + a regular call of Simplify.

What do you think?

 Peter

Revision history for this message
Mc (mc...) wrote :

(1) makes sense, I think.

Revision history for this message
Peter Mora (morapeter) wrote :

Hi,

 I collected and counted all the votes, it looks like option (1) has the majority (thanks Mc). I created a patch, please find it attached.

 Please note that I have no idea what else I could ruin with this patch. It solves this issue, please merge it only if it looks ok.

 Thanks,
  Peter

Revision history for this message
Mc (mc...) wrote :

pushed to trunk r15619, thanks for the patch!

Changed in inkscape:
assignee: nobody → Peter Mora (morapeter)
milestone: none → 0.93
status: Triaged → Fix Committed
Revision history for this message
su_v (suv-lp) wrote :

The fix committed in r15619 produces regressions when outsetting curves multiple times.

To reproduce:
1) launch trunk, default template (mm-based)
   set inset/outset step to 1mm
2) draw a circle (no fill, thin stroke), with about 5cm diameter
3) duplicate ( Ctrl+D ) and outset ( Ctrl+) )
4) repeat step (3) several times (10-12)

The resulting outset paths quickly divert from the original shape into ... nothing even close to the original circle.

Does not reproduce if the commit is reverted.

AFAICT the commit also tends to produce rather large numbers of nodes for in-/outset curves (compared to results with the commit reverted).

Proposing to revert the commit for now (and not to consider it for backporting to stable - testing it with 0.92.x was how I noticed the changed behavior).

Revision history for this message
su_v (suv-lp) wrote :

Demonstration of a circle outset multiple times with current git master (4a5430720).

Revision history for this message
Peter Mora (morapeter) wrote :

I see. Then I guess the inset/outset algorithm is not perfect (maybe that was the reason for applying simplify), and we should have a deeper look into the code to find out how to fix these issues. I'm a little bit busy these days, I'll try to come back when I have some time.

Revision history for this message
Alvin Penner (apenner) wrote :

still present in Windows 10, Inkscape 0.92.2 (5c3e80d, 2017-08-06)

still present in Windows 10, Inkscape trunk, Inkscape 0.92+devel (177a8e8, 2017-12-08)

(the nature of the defect in trunk is significantly different than in 0.92.2, but both defects are still clearly observable)

Changed in inkscape:
status: Fix Committed → Confirmed
Revision history for this message
Alvin Penner (apenner) wrote :

in view of the fact that trunk sometimes crashes randomly when performing this test, especially when insetting multiple times, I think it would be a good idea to revert rev 15619
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/15619

Revision history for this message
Joshua Trees (jtrees) wrote :

I have created a file which should be suitable for debugging this.

Revision history for this message
ra (rainharvester) wrote :

This bug is critical for CNC machines with small parts. I'm trying to do a linked-offset of a 5mm hole with a 3mm bit (inkscape:radius 5.3).

The resulting circles are all misshaped.

Messing with the Behavior->Steps "scale by" or "inset/offset by" do not fix this bug. (Why should they? Those are for keyboard steps).

I suspect many others are hitting this bug but haven't said anything.

Revision history for this message
Nathan Lee (nathan.lee) wrote :

Going through the example files, this is fixed in 1.0.

However, there is still some problem at small input sizes (similar to https://bugs.launchpad.net/inkscape/+bug/616469/comments/12 except doesn't affect those sample files). This is being tracked in https://gitlab.com/inkscape/inbox/-/issues/3371

Thanks for reporting!

Changed in inkscape:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.