Can we drop 'wrl' 3D models and keep only 'step' libraries, keeping artistic rendering?

Some time ago OCC (>= 7.5) has introduced the ability to import and export STEP format keeping transparency properties.
KiCAD has already moved to OCC >=v7.5 both in stable release and in the nightly one.
The same for FreeCAD that has included this option since the now stable 0.20 release.

Then the STEP 3d format could include transparency property when importing and exporting 3D models.

So, ATM the only issue in dropping the wrl models for KiCAD and keeping the ability to make realistic rendering, would be the missing option to assign materials to STEP models.

But that missing option could be workaround using a color table, which would assign a specific color to a specific material table of properties.
That is in fact already adopted when generating ‘wrl’ models from ‘step’ models in the 3D KiCAD generating scripts libraries.
The material properties are already coded using these documents

produced by @kammutierspule when we standardized wrl model generation.

That approach was already used by sparkfun for rendering pcb 3d models.

In this way KiCAD could drop the need to have a double 3D library which is in fact a library duplicating the model information only to add realistic rendering.

Could it be an option for the next stable release?

3 Likes

This would be something to propose to the KiCad library team.

I don’t know if at moment KiCad supports transparency on STEP loader plugin? Did you tried it?

I don’t think ATM KiCad is supporting transparency on STEP import/export but the adopted OCC release is enabled to do it.

We need to know if this option would be interesting for some of the KiCad developers…
@Seth_h @JeffYoung what do you think?
In case of positive reply, we can write a requirement list to be implemented…

Does this mean that KiCad could still export to VRML with all footprint 3D models even though the models are only STEP?

I don’t know what “OCC” stands for.

OCC = Open Cascade Technology which is the KiCad (and FreeCAD) 3D kernel for STEP importing/exporting

1 Like

yes, as now in KiCad a 3D model of a footprint available only as STEP format can be exported as VRML model and can be visualized in the 3D viewer (without the feature to display enhanced material properties).

The suggestion is not in the direction to reduce the abilities of KiCad, but only to avoid to duplicate the 3D model libraries, just to add nice and useful material rendering properties…

4 Likes

I think that this is a great idea. If someone writes up a work package for this development, we can talk about funding this work and timelines. Let me know if you need any details on the process

This is a bit too late in the v7 development cycle to build this for v7 but this could be an excellent v8 addition

5 Likes

:partying_face:

I could put some points, referring to what had done with the 3D libraries to associate colors to material properties as it is done in KiCad StepUp and in the scripts to generate 3D models.
Most libraries are already compatible with standardized material properties as in KiCAD’s VRML documents.

:sob: I hoped it was in time

:+1:

Feature freeze is the end of September. I don’t have a strong sense of how complicated this feature is, so if you think it might be achievable in the next 4 weeks (STEP import/3d viewer/STEP export), then it could be v7.

@Seth_h
I’m going to write down the requirements, so we could see how much work could be involved…

Transparency for STEP import/export could be tricky, but the part to assign material as in a color table should be quite straight…

ATM KiCAD is already parsing STEP models and converting the model to 3D scene, simply assigning diffuse properties based on face color, without the other material properties (ambientIntensity, specularColor, emissiveColor, shininess).
The code should just add a table of values in case of a matching diffuse color attribute assigned as defined material of the library.
This first step would be a valuable improvement even without the transparency feature.

2 Likes

O, I meant to convert the loader to use RGBA instead of RGB months ago but misplaced the commit when I was battling the other step loader issues

Exporting 3d models should already keep any material properties because the exporter is just lazily stitching step files together, we aren’t removing anything

@marekr
Full support for material properties in STEP would be the best…

ATM FreeCAD does support transparency, but AFAIK doesn’t support material import export in STEP format.

A table of defined material, as we have adopted for VRML would be a nice first step forward in that direction, that would be already compatible with the actual STEP libraries.

I’ve been Exporting Transparent STEP’s from FreeCAD for the past several versions of FreeCAD. I currently have only V20 so can’t demo the previous versions for this post.

But, here’s a screenshot of a Step I just Exported with Transparency color and then imported it back into FreeCAD. All works Perfect! Just ‘Exported’ it. I did Not use KSU-StepUp

@BlackCoffee
Transparency was introduced late on FC0.19 (19.4 I think) and transparency on faces only in FC 0.20

Transparency doesn’t mean full material support for STEP import/export…
(ambientIntensity, specularColor, emissiveColor, shininess).

Edit: here the link to the discussion, when the transparency has been added to STEP import/export in FC (october 2021)
https://forum.freecadweb.org/viewtopic.php?p=537449#p537449

Understood and Thanks but, not too interested in the Past version ability…

I just now changed Appearance parameters (screenshots of Before and After and Results… Also set materials to Plaster… Works for me…)

You can see the Redish emmisivity with its Blueish spectral aspect…

I just now changed Appearance parameters (screenshots of Before and After and Results… Also set materials to Plaster… Works for me…)

you miss the part of exporting and importing those parameters in STEP format (not just natively in FC format)

I didn’t miss the point, I just didn’t bother to re-import it.

But, here:

Imported it (on Left) Changed the Appearance parameters, Exported Step and Imported the Step (on Right). All with Plaster material, Difuse,Emmissive, Specular and Shininess all tweakable and Imorted as Step

I use a Mac!

I didn’t miss the point, I just didn’t bother to re-import it.

which are you STEP import/export settings in FC?
would you please post your STEP i/o preference page image in FC and your FC full release info?

I can keep transparency and color but not the other properties…
When you click on the imported object, can you show its properties tab?

1 Like

I will admit my ignorance (and laziness) which somewhat makes the Questions & Answers irrelevant, especially considering I looked at the Exported Step file contents and see nothing related to Emissivity, Spectral…etc. (content snippet below)…

#277 = STYLED_ITEM(‘color’,(#278),#15);
#278 = PRESENTATION_STYLE_ASSIGNMENT((#279,#287));
#279 = SURFACE_STYLE_USAGE(.BOTH.,#280);
#280 = SURFACE_SIDE_STYLE(’’,(#281,#285));
#281 = SURFACE_STYLE_FILL_AREA(#282);
#282 = FILL_AREA_STYLE(’’,(#283));
#283 = FILL_AREA_STYLE_COLOUR(’’,#284);
#284 = COLOUR_RGB(’’,0.,0.666666687201,1.);
#285 = SURFACE_STYLE_RENDERING_WITH_PROPERTIES(.NORMAL_SHADING.,#284,(
#286));
#286 = SURFACE_STYLE_TRANSPARENT(0.649999976158);
#287 = CURVE_STYLE(’’,#288,POSITIVE_LENGTH_MEASURE(0.1),#289);
#288 = DRAUGHTING_PRE_DEFINED_CURVE_FONT(‘continuous’);
#289 = COLOUR_RGB(’’,0.666666687201,1.,1.);

The Step i/o is in the image above

FC info:
OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git)
Build type: Release
Branch: (HEAD detached at 0.20)
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.9.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: C/Default (C)

That said, there is a Shinny-ness on the Model along with Transparency that also bares out in both FC and in FC’s, Save_Picture, below… This is expected, given it’s within FC even though it’s an Imported Step

Also, I don’t know what’s changed (FC and/or Kicad, but sometime ago I did some transparency tests in Kicad (using FC exported Step) and the Transparency was OK (last image). However, Kicad does not seem to like Transparency, today…

Note: Prior to FC20 (I don’t remember specific version, about Two yrs ago), the Export panel showed two Step export selection Options; one was Step, the other was Step_With_Colors. The ‘Step’ has disappeared from the Export panel…

Transparency used to work in Kicad… The Colors were Set using KSU-StepUp BUT, Step was exported from Part_Design wb.