← Back to team overview

kicad-developers team mailing list archive

Re: VRML export.

 

On Sat, Oct 4, 2014 at 10:52 PM, Wayne Stambaugh <stambaughw@xxxxxxxxxxx>
wrote:

> On 10/3/2014 8:15 PM, Cirilo Bernardo wrote:
> > On Sat, Oct 4, 2014 at 5:33 AM, Wayne Stambaugh <stambaughw@xxxxxxxxxxx
> > <mailto:stambaughw@xxxxxxxxxxx>> wrote:
> >
> >     I've been trying use Pcbnew the VRML export for a board a work and
> >     discovered some serious design issues with the way file names are
> >     manipulated which broke exporting the model files on windows.  I
> fixed
> >     those and while digging around in the VRML export code, I noticed a
> few
> >     things that didn't make any sense to me.  Why are only .x3d file
> names
> >     embedded inside the board VRML file and not .wrl files?  Why are the
> >     .x3d file names embedded even when they are copied to the 3D model
> path?
> >      Why wouldn't you either embed all the footprint models in the board
> >     file or copy all of the footprint model files to the 3D model path?
> It
> >     seems to me it should be one or the other not both.  The use relative
> >     paths in the board VRML file option does nothing as far as I can
> tell.
> >     I'm willing to fix this but we need to define what this behavior
> should
> >     be because what we have now is rather chaotic.  My initial feeling is
> >     that the embedded code should be removed until we can embed all
> >     supported 3D model file formats.  Anyone else have any thoughts on
> this?
> >
> >     One more note.  Please use wxFileName instead of wxString when
> >     manipulating file names and paths.  I've probably fixed a dozen or so
> >     places over the years where this same wxString path manipulation code
> >     has been used and has caused nothing but grief.  Please keep in mind
> >     that we are a cross platform application.  If you need Posix path
> >     separators for saving paths and/or file name in files, use
> >     wxFileName::GetFullPath(wxPATH_UNIX).  This will convert the
> separators
> >     from \ to / and still allow you to use native paths for file
> operations
> >     internally which is more reliable.
> >
> >     Thanks,
> >
> >     Wayne
> >
> >
> > Hi Wayne,
> >
> >  I'll find some time to have a look at the issues.  I don't get what you
> > mean
> > by the x3d file names being embedded and not the wrl files. I always
> thought
> > it was the other way around. The X3D model data is written to the output
> > VRML file but the VRML data is retained as separate files and only the
> names
> > are put into the output VRML file. Embedding the X3D model date assures
> > VRML2 compatibility; a VRML2 browser will not necessarily be able to
> > parse and display the contents of an x3d file. I didn't realize the x3d
> > models
> > were being copied to the path as well; that's just wrong.
>
> Cirilo,
>
> Please don't fix anything just yet until I commit my changes.  Otherwise
> we will have clashes in the code.  You may be correct about the x3d
> files but I don't have any of them to test the code.  Looking at the
> code, the output of the x3d to vrml conversion is being added to the
> board vrml file not to a separate model file in the 3D model path which
> is where I would expect it to go.  I also fixed a memory leak for every
> x3d parser that is created.  If you happen to have an x3d model of a
> component, please send it to me so I can test/fix this code path.
>
> No problem, I'll wait until you've committed your changes.

I'll keep people informed on any progress on my wishlist. Developments with
STEP would be of particular interest to people and it's no small job so we
definitely want to avoid duplication there. I'm currently looking into using
'StepCode' (formerly STEP Class Library) because I want a well structured
assembly as an output. I've discarded OpenCascade since it cannot
produce an assembly that I would ever care to work with in MCAD; pretty
much every feature of every component is a 'part' in one big flat 'product'
and no MCAD user wants to waste time with such a thing.

- Cirilo

References