Creating textured STEP models for 3D view


#1

I’m using the new support for STEP models in the 3D viewer and absolutely love it.

However, I’m wondering what tools people use for creating 3D models, especially ones with textures. So far I’ve tried FreeCAD, which (as of yesterday’s HEAD) can add a texture to a Draft rectangle but then can’t export that to STEP; converting the draft rectangle to a sketch to try to make it solid loses the texture. And I’ve tried Blender, which has great texture support but can’t directly import STEP and certainly can’t re-export it.

What do people use, both for creating models from scratch and for adding textures to existing STEP models? FOSS options definitely preferred.


#2

Hi Tom,
I am happy that you are enjoying 3D viewer.

Unfortunately, at moment, there is any kind of (images) texture load for 3D Viewer.
I am not sure also if STEP supports textures at all.

However, depending on what you consider “textures” there could be some ways to get it displayed in 3D Viewer.

Have a look on my answer on this thread:

The idea is to “vectorize” what you consider the “texture” and convert it to a 3D shape (ideally non solid, for performance)
So most of the things like text on ICs or packages in 3D are created on some kind of this way. (extruding+add or extruding+subract)


#3

Hi Mario @kammutierspule ,
there are two methods to add a texture to a wrl file…
VRML has two texture nodes that can contain image data:
ImageTexture, which offers the field url and thus uses external image files
PixelTexture, which offers the field image and thus actually embeds image data in the VRML file.
Both method are not supported in KiCad 3D viewer ATM
There is a nice thread at freecad forum (unfortunately in German)
https://forum.freecadweb.org/viewtopic.php?f=13&t=27386
Here a sample of the two wrl files
freecad wrl url & embed files

There is also a nice python code snippet to convert a wrl with url in to a wrl embedded
https://forum.freecadweb.org/viewtopic.php?f=13&t=27386#p219978

Do you think it could be implemented in dev V6? :wink:
EDIT:
If you could enable the url option in 3D viewer, I could add an option to map a texture to a face when exporting a STEP file to wrl in FreCAD StepUp :wink:

PS an old post about texture


#4

Hi Maurice.
Of course I know about textures on VRML but Tom was just referring to STEPs.

I don’t have in mind to add support for 3D models with textures :confused:
but I think it would be easier to just add support to add an image file as a 3D plan, so users can rotate, resize and place it. :wink:
( I think Altium has something similar? )

On relation to Edit: There may be some different ways using VRML to assign textures to stuff (eg: VRML supports planes I guess and can assign a texture to it) but it will also be slight more difficult.


#5

I see. Thanks for the quick response. What I though were textures on other components do indeed turn out to be slightly pocketed contours.


#6

I know you know it :wink:
but

  1. there is NO support for texture in STEP AP214 format
  2. Tom is asking to create 3D models with texture to be displayed in KiCAD

and

With StepUp it could be possible to export the WRL model of the STEP model with a Texture wrl file assigned to i.e. a specific Material…
Moreover now KiCAD has cloned the way that StepUp is substituting WRL models to STEP when doing the STEP Export conversion, so using a WRL would help both in 3D viewer Appearance and Mechanical designing

The easiest (and without the need to change the pcbnew format) mode would be to manage a Material as an external WRL texture reference
StepUp could assign an external wrl file to a specific face when exporting the WRL model generated from a STEP model.
Then with a little code changes, this feature could be available :wink:

Shape {
    appearance Appearance {texture DEF TEXTURE-01 ImageTexture {
        url "./freecad-doc.png"
        }
    }
}
Shape {
    appearance Appearance {material DEF PIN-01 Material {
        ambientIntensity 0.271
        diffuseColor 0.824 0.820 0.781
        specularColor 0.328 0.258 0.172
        emissiveColor 0.0 0.0 0.0
        shininess 0.70
        transparency 0.0
        }
    }
}
Shape { geometry IndexedFaceSet 
{ creaseAngle 0.50 coordIndex [0,1,2,-1,0,2,3,-1]
coord Coordinate { point [3.937 3.937 3.937,3.937 3.937 0,0 3.937 0,0 3.937 3.937]
}}
appearance Appearance{
    texture USE TEXTURE-01
}}

instead of

Shape { geometry IndexedFaceSet 
{ creaseAngle 0.50 coordIndex [0,1,2,-1,0,2,3,-1]
coord Coordinate { point [3.937 3.937 3.937,3.937 3.937 0,0 3.937 0,0 3.937 3.937]
}}
appearance Appearance{
material USE RED-BODY 
}}

In FreeCAD it is easy to assign a specific color to a Face/Plane, then it would be very easy to add a Texture to a Plane/Face when exporting a STEP model to WRL, for the use in KiCAD.
No need to add Dialog in KiCAD … simply the feature to support external linked WRL texture/files


#7

The generic STEP format does not have a feature to assign textures to models. If I remember corrrectly, the STEP AP214 format can include an information on color while AP203 has way of saving color information.


#8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.