← Back to team overview

kicad-developers team mailing list archive

Re: 3D-Viewer new rendering and contributions.

 

----- Original Message -----

> From: jp charras <jp.charras@xxxxxxxxxx>
> To: Mário Luzeiro <mrluzeiro@xxxxx>; "kicad-developers@xxxxxxxxxxxxxxxxxxx" <kicad-developers@xxxxxxxxxxxxxxxxxxx>
> Cc: 
> Sent: Thursday, July 31, 2014 4:29 AM
> Subject: Re: [Kicad-developers] 3D-Viewer new rendering and contributions.
> 
> Le 30/07/2014 19:48, Mário Luzeiro a écrit :
>>  Hi Nick,
>> 
> ...
> 
>> 
>>>  I have problems with an older design, where the models are offset
>>>  way too much. Some unit problem?
>> 
>>  I notice in some models that I got in the web (ex: Walter) (you can
>>  see in my first screenshots, in the SMD resistors) that they have
>>  added some offset in Z coord. You see that they are "levitate" in 
> the
>>  PCB board. I dont know why they added it. Also IMPORTANT: I added now
>>  in VRML 2 the capability to parse transformation data (rotation,
>>  scale, scaleOrientation, center.. ) As Cirilo Bernardo pointed
>>  correctly, If the code is implemented correctly and the problem are
>>  in the model files, so the model files should be fixed. Check in your
>>  model files for the "Transform" tag and see if they have
>>  transformation data. If you have that Transform, you can remove it
>>  (whatever makes sense to you / your model)
> 
> I also saw it.
> 
> Looks like a unit issue.
> For an historical reason, offset is given in inch.
> Seems the conversion to internal units is not good.
> 
> To see this issue, just edit a 3d shape parameters of any footprint on a
> board.
> 
> If you want an offset = 0.1 inch (easy to test with a DIP package), you
> need to enter 0.1/25.4
> 
> -- 
> Jean-Pierre CHARRAS
> 
> 


One thing I'm not very happy about in my IDF export is that the offset
units are the same as the IDF output units. However, the VRML exporter
expects units in inches, so the text in the offset dialog is misleading
for anyone working with IDF models. I didn't make any changes because I
didn't want to upset the way VRML worked and I couldn't think of a good
solution at the time. The issue is like this:

1. 3DViewer: oldest user of the 3D models so all other users must respect
the way it works. 3DViewer uses inches because the models are expected
to be in 0.1 inches per unit and the internal board unit is not a convenient
unit for any user.

2. VRML export: uses the convention of 3DViewer. The inches is converted
as necessary for VRML output to mm/m/in.

3. IDF exporter: the offset will be interpreted as IDF output units. If
the IDF output is in mm (default) then it will be mm; if the output is
THOU then it will be 0.001in. Maybe this is not the best thing, but for
me I couldn't use the same behavior as the VRML code because it makes no
sense to design a board in mm, export IDF in mm, but specify model
offsets in inches.

Any suggestions on how this can be unified will be welcome. One option
is to add a selection item to the VRML dialog to specify if the offset
is mm or inch. With that option I can also implement a good IDF solution.

- Cirilo



Follow ups

References