VRML Export Rotation/Offset Incorrect

Bug #703169 reported by Mark Gifford
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
KiCad
Expired
Undecided
Unassigned

Bug Description

Platform: Windows 7 x64, KiCAD build: kicad-2010-12-23-BZR2684_stable_branch-RC3b

If a footprint has a 3D model with non-zero offset or rotation specified, the exported board VRML will have incorrect rotation and offset values for that 3D model and they come out crooked. For instance, if a part has a 3D rotation of 90 degrees specified, the board VRML will rotate that part 9 degrees. 180 degrees specified results in an 18 degree rotation. It is off by a factor of ten for rotation. Possibly due to the code in lines 1060-1065 of export_vrml.cpp?? The offset is also incorrect. It appears that the 3D part offset is not applied to the VRML output at all. However, scaling works correctly....

To reproduce the problem:

Simply place a footprint and edit the 3d setting to apply a 90 degree rotation. Then export the VRML and view it in Blender or freeWrl viewer.

See attached picture for KiCAD 3D view (left) versus VRML Export (right)

Revision history for this message
Mark Gifford (splurt753) wrote :
Mark Gifford (splurt753)
summary: - VRML Export Scaling Incorrect
+ VRML Export Rotation/Offset Incorrect
description: updated
Revision history for this message
jean-pierre charras (jp-charras) wrote :

Fix committed in testing branch

Changed in kicad:
status: New → Fix Committed
Changed in kicad:
status: Fix Committed → In Progress
Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Mark Gifford (splurt753) wrote :

Almost perfect, but line 1091 need to be changed to this:

        int offsety = - wxRound( vrmlm->m_MatPosition.y * UNITS_3D_TO_PCB_UNITS ); // Y axis is reversed in pcbnew

(All I did was add a negative sign here)

I tested this locally and it works fine. Please update it in the testing branch. Thanks!!

Changed in kicad:
status: Fix Committed → Incomplete
Revision history for this message
jean-pierre charras (jp-charras) wrote :

Should be fixed now (even for flipped footprints).

Revision history for this message
Mark Gifford (splurt753) wrote :

Yep, that fixed it.

By the way, I also noticed that arc are drawn with an inverted x axis.... :(

I fixed it by changing the "startx + cos" to "startx - cos" in lines 509, 567, and 568

Revision history for this message
jean-pierre charras (jp-charras) wrote : Re: [Bug 703169] Re: VRML Export Rotation/Offset Incorrect

Le 20/01/2011 07:04, Mark Gifford a écrit :
> Yep, that fixed it.
>
> By the way, I also noticed that arc are drawn with an inverted x
> axis.... :(
>
> I fixed it by changing the "startx + cos" to "startx - cos" in lines
> 509, 567, and 568
>

Have you an sample(a footprint reference? )
I am unable to reproduce this issue.

--
Jean-Pierre CHARRAS

Revision history for this message
Mark Gifford (splurt753) wrote :

Yeah, just draw a simple arc on either the silkscreen or pcb edges layers and export a VRML (it may happen on other layers too?) Attached is a screenshot of how it comes out using the 2010-12-23 build.... Those corners are supposed to be rounded. Using Blender to view output...

Revision history for this message
Robert (birmingham-spider) wrote :

I've just hit this arc bug myself, the arc being on the edges layer.

Application: PCBnew
Version: (2011-01-22 BZR 2754)-stable
Build: wxWidgets 2.9.1 (wchar_t,compiler with C++ ABI 1002,GCC 4.4.0,wx containers,compatible with 2.8)
Platform: Windows XP (build 2600, Service Pack 3), 32 bit, Little endian, wxMSW

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for KiCad because there has been no activity for 60 days.]

Changed in kicad:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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