Trouble with 3D Models(VRML)

Hi,

I have now started to create 3D models and encountered a problem when I selected a .wrl file and tried to save. The following error message is displayed: "following characters which are not allowed <% $ ‘tab’ ‘space’ \ " / > were found in >SMK footprints:D_Pak>
SMK footprint ist directroy in which D_Pak.wrl is stored.
Later I tried with the default directory but got the same result.

any help?
thanks

which kicad version?
which sw you use to create wrl (or you get it from on-linelib)?
upload (uplink) your wrl

Hi maui,

I used NX. First I suspected that there is the trouble, but then I checked with cortona3d viewer and could not find any errors. Then I found out that even loading from KiCad default directory “-\packages3D” resulted in this error when I tried to ok. Something seems to be corrupted within the KiCad or at least the footprint editor. In any case I have attached the file.

D_Pakx.wrl (37.6 KB)

@KiCADsmktec
kicad 3d-viewer does support a subset of VRML syntax, so not all the VRML structure can be correctly loaded/displayed…
If you can export your model to STEP, then you can convert to VRML through FreeCAD using PartToVRML macro, which is fully compatible with kicad, or you can use the kicad StepUp tools (which can help you also in aligning the 3d model to the footprint)

and here some useful 3D libraries with a MCAD touch

Hi @KiCADsmktec
I searched in several places of the current KiCad source code, in the web, etc
and I could find a reference to the strings “following characters which are not allowed”
What and where are you save it? On what software?
(What is NX?)

I believe this is not related with the contents of the WRL file it self, but something else.

Btw, you may have a look on this two tutorials I created that explain how to setup proper materials to the models:

I looked in your WRL file, I think it look fine, but you can improve it by clean all things that KiCad 3d-viewer dont support. You can safe delete:
DirectionalLight
Background

It is also ok to remove the normals:
remove this lines: “normal Normal { vector [ … ] }”

Kicad will be able to calculate it for you.

sounds like one of the fields, especially the module name have a character like that in there upon saving - that’s a thing of the .kicad_mod file.
What have you in the footprint editor for the value and reference fields?
And if there are any other fields, check them as well…

thanks a lot for all your input,

I will check them (will take a little bit) and feed back my findings.
Felix

I have started to investigate. First thing I opened the footprint editor started a new footprint and went to 3D settings where I added three .wrl files which still resided on my PC from the past experience. One of them resulted in a software crash, similar to the past experience.
Opening the 3D viewer the following came out.
the D_Pakx.wrl was displayed although the surface were not closed.
the D_Pak.wrl caused the entire KiCAD to crash.
I am not yet familiar with .wrl files, so maybe someone of you guys could see what causes the trouble.

thanks,

D_Pakx.wrl (37.6 KB)
D_Pak.wrl (37.0 KB)

As previously pointed out kicad 3d-viewer has a limited support for VRML parser structure…
Once it was almost limited to Wings3D vrml exporting format.
Now it accepts also VRML coming from FreeCAD.
I would suggest this workflow:

  • Take your NX 3D model and export it in STEP
  • download kicad StepUp
  • open kicad StepUp tools in FreeCAD
  • load your STEP model in FreeCAD, and your footprint with kicadStepUp tools
  • align it to fp and export wrl and STEP with the kicad StepUp export button
    There your model will be aligned and readable by kicad viewer
    (have a look at the kicad StepUp video tutorial or just feel free to ask)
    M

thanks,

that’s probably the best thing to do.

One problem with D_Pak.wrl is that it is not VRML1 compliant. A VRML1 model should only have one top node and it must be one of Switch, Group, or (most common) Separator. The only reason other viewers display the model is that they either ignore the other nodes or they pretend that all the contents of a VRML1 file are effectively children of an implicit Group node.

Once the file is fixed so that the top node is a Separator the new 3D parser and viewer will display the model. I can verify that the legacy viewer segfaults; I can’t understand why since the model is very simple but I have no plans to fix it. However since this is the stable release, you should file a bug report at https://bugs.launchpad.net/kicad

Someone who knows the legacy code well might fix it. The same goes for the VRML2 model; it is handled correctly by the new 3D code and I have no idea why the legacy code fails (missing many surfaces) when the model file only uses supported VRML structures.