← Back to team overview

kicad-developers team mailing list archive

Re: comments and questions on SEARCH_STACK

 

Are you saying using ${KIPRJMOD}/my3dmodel.wrl in the 3D shape name does
not work?  If not, I'm not sure what you are describing here.

I mean that if you change the previously assigned $KIPRJMOD path to a 3d model you get this error:
'could not set working directory' as in the attached png

It would be also useful to use/insert '$KIPRJMOD' variable when choosing
relative path.
Relative path is NOT working in windows.

Relative path don't work anywhere except in a few carefully controlled
situations.  The problem with relative paths is what path are the
actually relative to.

IMO it would be useful to change relative path to $KIPRJMOD path, so it would be easier to insert the $KIPRJMOD variable, just choosing relative option, in a user friendly way
In the old stable release the relative path worked smoothly

Which files are you talking about?  AFAIK, you can add any environment
variable expansion ${ENV_VER} to a 3D footprint in the footprint editor.

editing the .kicad_pcb file directly, but with the GUI as suggested is easier...


On 14/09/2015 19.05, Wayne Stambaugh wrote:
On 9/14/2015 10:29 AM, easyw@xxxxxxxxxxxx wrote:
Hi,
moreover it seems that $KIPRJMOD variable is not understood when
changing a path in 3D model selection that has already that value
configured
(Footprint Properties, 3D settings, 3D shape name)

Are you saying using ${KIPRJMOD}/my3dmodel.wrl in the 3D shape name does
not work?  If not, I'm not sure what you are describing here.


It would be also useful to use/insert '$KIPRJMOD' variable when choosing
relative path.
Relative path is NOT working in windows.

Relative path don't work anywhere except in a few carefully controlled
situations.  The problem with relative paths is what path are the
actually relative to.


At the moment the variable, in my knowledge, can be put only by hand
with a text editor.

Which files are you talking about?  AFAIK, you can add any environment
variable expansion ${ENV_VER} to a 3D footprint in the footprint editor.



On 9/14/15 5:31 AM, Cirilo Bernardo wrote:
Hi folks,

   I was just looking into how KiCad currently handles partial paths for
files and I have found:

(a) 3D model paths are now resolved exclusively via the KISYS3DMOD
environment variable

(b) kiface_i.cpp contains what appears to be some dead code:
(lines 64 - 76):

          // Add PCB library file path to search path list.
          if( aId == KIWAY::FACE_PCB || aId == KIWAY::FACE_CVPCB )
          {
              fn.AppendDir( wxT( "modules" ) );
              aDst->AddPaths( fn.GetPath() );

              // Add 3D module library file path to search path list.
              fn.AppendDir( wxT( "packages3d" ) );
              aDst->AddPaths( fn.GetPath() );

              fn.RemoveLastDir();
              fn.RemoveLastDir();     // "../../" up twice, remove
modules/packages3d
          }

While I haven't checked if "modules" is used (I presume it is since
schematic
symbols are there), I don't believe the "packages3d" directory is ever
searched
via the SEARCH_STACK object. I suggest we remove the lines 70..74:
              // Add 3D module library file path to search path list.
              fn.AppendDir( wxT( "packages3d" ) );
              aDst->AddPaths( fn.GetPath() );

              fn.RemoveLastDir();

My reasons are (1) anyone who's already set up to use 3D models is
no doubt using KISYS3DMOD and (2) the 3D code in my refactoring
branch will have its own configuration file containing path roots for
3D models and will not use SEARCH_STACK anyway. (Then again
I can always make a small change to use SEARCH_STACK.)

Another suggestion for SEARCH_STACK: there are obviously a
few hard-coded assumptions about paths and paths are added
without checking that (a) they exist and (b) they are directories.
If we eliminate candidate paths which do not exist or are not
directories then we may save some time otherwise wasted
searching non-existent paths; this will also avoid the error which
I frequently get complaining about items not being available
in non-existent paths.

- 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


_______________________________________________
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

_______________________________________________
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


Attachment: 1.png
Description: PNG image


References