← Back to team overview

kicad-developers team mailing list archive

Re: filename resolution in 3D models

 


On 1/12/2016 8:15 AM, Mário Luzeiro wrote:
> "2. when the file's full path is not a superset of an existing search path
> how do we ensure that the stored path is a valid path on MSWin/Linux/
> OSX?"
> 
> I dont know about this issues with paths, but, if the user stores an "windows" path, then.. it should store it as is and it will only work on windows systems.

This is not portable and therefore not acceptable.

> For relative paths, can we store a flag that it is relative? or as you suggest, add always the ../ ? then.. open it as relative everywhere

Also not acceptable as relative paths are not robust.  I've already
explained why that is the case.

> 
> For 1) we should go use some kind of priorities.. local project folder should be the first.

There should not be any path look up priority because paths should be
fully qualified and unambiguous.  This is exactly what fp-lib-table
does.  If you have it configured properly, you are ensured that the
correct file will be loaded.

> 
> Mario
> ________________________________________
> From: Kicad-developers [kicad-developers-bounces+mrluzeiro=ua.pt@xxxxxxxxxxxxxxxxxxx] on behalf of Cirilo Bernardo [cirilo.bernardo@xxxxxxxxx]
> Sent: 12 January 2016 01:05
> To: KiCad Developers
> Subject: [Kicad-developers] filename resolution in 3D models
> 
> Hi folks,
> 
>  I'm looking for some comments/suggestions on how to deal with 3D model
> filename resolution. My current 3D refactor branch behaves in much the
> same way as the main branch except that I can specify many model
> search paths. Issues with this scheme include:
> 
> 1. how do we deal with multiple equivalent filenames
> 
> 2. when the file's full path is not a superset of an existing search path
> how do we ensure that the stored path is a valid path on MSWin/Linux/
> OSX?
> 
> For (1) I'm thinking we can use a scheme similar to fp-lib-table where we
> specify a 'nickname' for a base path and provide for an optional comment/
> description. The chief issue I see with this scheme is that the kicad_pcb
> file will have to contain the nickname within the model name and earlier
> versions of kicad will not be able to process project files which have the
> nickname in the model name. This may not be such a big problem as the
> user can do a string replacement to transform the names, but if data is
> being shared both ways between 2 different kicad versions then the model
> naming can be a nuisance.
> 
> For (2) I was thinking of converting the path to a path relative to the project
> directory. So "/home/user/models/a3dmodel.wrl" or "c:\models\a3dmodel.wrl"
> might become something like "../models/a3dmodel.wrl". The relative path
> will not necessarily exist on another computer but at least we don't have
> the complication of a MSWin vs UNIX file path root.
> 
> Any comments/suggestions?
> 
> - Cirilo
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 


References