VRML export: AddArc(): width/2 exceeds radius*1.01

Bug #1536786 reported by Sourcerer on 2016-01-21
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Low
Seth Hillbrand

Bug Description

When exporting a converted file to VRML, I get the error message
AddArc(): width/2 exceeds radius*1.01
(from utils/idftools/vrml_layer.cpp AddArc() )
then the VRML generation stops and the there is no output file.

1. The error message does not state which arc is causing the problem, my test-file had about 100 arcs, so it was hard to find the right one. Please always add the coordinates and the layer in the error messages, so that the user can find the culprit. (I think this problem applies to lots of error messages in the VRML exporting code)

2. KiCAD does not give a warning when loading a file with such arcs or when creating such an arc, only when the VRML export is used.

3. One of the several arcs that triggered this was the Pin-1 marker (a dot / filled circle) in a footprint, so I guess that it will occur in component libraries from component vendors. I agree that an Arc where the width is larger than the radius is a bit nonsensical. But it works in KiCad 2D, 3D and Gerber and also in other PCB design applications, and I am afraid that I am altering the effectively generated output, if I try to automatically correct it to enable VRML output.

4. KiCad does not allow to ignore the arc to continue generating the rest of the VRML file. I think such arcs are not such a grave problem in the file that a VRML file should not be generated at all.

I could help with patches for this and similar problems, but I would like to know your opinion on how to solve it best first.

Nick Østergaard (nickoe) wrote :

Could you provide your VRML file as a sample for testing?

Nick Østergaard (nickoe) wrote :

And one important think I think you missed while doing a good effort in describing your problem. Which kicad version?

tags: added: vrml
Sourcerer (pg-futureware) wrote :

KiCad version 4.01, but I see the same sourcecode on the GitHub repo: https://github.com/KiCad/kicad-source-mirror/blob/c4ea4dc0dfe60cb34ac57ac9f533faf928e331cf/utils/idftools/vrml_layer.cpp

I cannot provided a VRML file as a sample, since I cannot generate one due to this bug, but I will provided a KiCAD PCB file.

Sourcerer (pg-futureware) wrote :

Now I created a better visualisation of the problem.
The rightmost arc is the problematic one, it has "grown too fat".
If you delete the arc on the right side, you can export it to VRML.

Sourcerer (pg-futureware) wrote :

How to reproduce it:
Open the file in KiCad
Click on File-Export-VRML
Click on OK.
Now you should see 2 error messages, click OK.
Now select the right arc and delete it.
Click on File-Export-VRML
Click on OK.
Now it should be exported properly.

Changed in kicad:
status: New → Confirmed
tags: added: pcbnew
Changed in kicad:
importance: Undecided → Low
Sourcerer (pg-futureware) wrote :

I would like to showcase KiCad in a few weeks, which way you want this issues fixed, so that I can develop a patch and have it running in time for the show?

Sorry, I had missed this one. I think the best solution is to look where
that message is issued and instead of failing, ensure that the appropriate
variable is set so that width/2 = radius * 0.99. This helps to avoid
invalid geometry in most cases, and in the cases where the geometry is bad
it will at least not be so obvious.

In general, kicad should enforce more checks to ensure this bad geometry
doesn't happen. The correct behavior depends on the exact circumstances for
the object. This is not the first time we had trouble with arcs or drill
holes.

- Cirilo

On Mon, Feb 29, 2016 at 1:49 AM, Sourcerer <email address hidden>
wrote:

> I would like to showcase KiCad in a few weeks, which way you want this
> issues fixed, so that I can develop a patch and have it running in time
> for the show?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1536786
>
> Title:
> VRML export: AddArc(): width/2 exceeds radius*1.01
>
> Status in KiCad:
> Confirmed
>
> Bug description:
> When exporting a converted file to VRML, I get the error message
> AddArc(): width/2 exceeds radius*1.01
> (from utils/idftools/vrml_layer.cpp AddArc() )
> then the VRML generation stops and the there is no output file.
>
> 1. The error message does not state which arc is causing the problem,
> my test-file had about 100 arcs, so it was hard to find the right one.
> Please always add the coordinates and the layer in the error messages,
> so that the user can find the culprit. (I think this problem applies
> to lots of error messages in the VRML exporting code)
>
> 2. KiCAD does not give a warning when loading a file with such arcs or
> when creating such an arc, only when the VRML export is used.
>
> 3. One of the several arcs that triggered this was the Pin-1 marker (a
> dot / filled circle) in a footprint, so I guess that it will occur in
> component libraries from component vendors. I agree that an Arc where
> the width is larger than the radius is a bit nonsensical. But it works
> in KiCad 2D, 3D and Gerber and also in other PCB design applications,
> and I am afraid that I am altering the effectively generated output,
> if I try to automatically correct it to enable VRML output.
>
> 4. KiCad does not allow to ignore the arc to continue generating the
> rest of the VRML file. I think such arcs are not such a grave problem
> in the file that a VRML file should not be generated at all.
>
> I could help with patches for this and similar problems, but I would
> like to know your opinion on how to solve it best first.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1536786/+subscriptions
>

Seth Hillbrand (sethh) on 2018-06-23
Changed in kicad:
assignee: nobody → Seth Hillbrand (sethh)
milestone: none → 5.1.0
status: Confirmed → In Progress
Seth Hillbrand (sethh) wrote :

Need to kick the can down the road on this one

Changed in kicad:
milestone: 5.1.0 → 6.0.0-rc1
status: In Progress → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers