3D Models KiCAD Wishlist

I start thinking on that… but still didn’t get a solution…

for that reason you can choose tessellation factor in the macro…
In my new kicad StepUp macro when you export your model there is a dialog to confirm tessellation value …
Anyway I found that 0.03 is fine for small objs and 0.1 or 1 is good for big objs (e.g. enclosure)…
Moreover the rendering time I found is always much faster (5 times) then the standard FC exporter…

sorry, I remember that you said it shouldn’t so difficult in a recent post

Anyway, if you find a solution, please let me know :smiley:
thank you
Maurice

Ah nice! so you can set it also per exportation…

Ups maybe I was too optimistic :slightly_smiling:
It is not an hard thing… but I have to find how it can be implemented… and it takes time.

@Joan_Sparky
Another important thing! I found that your MELF model have double layers in some parts
ex: the ring of the diode, have one outer cylinder and a inner cylinder.
The glass also have one outer cylinder and a inner cylinder
So that is extra unnecessary information that will also will not help the render :confused:

so if some how you can make “1 layer” surface it would help.

I found also that for some reason, looks like you model is “sub-divided” in some parts. I dont know why if that is related with the model process…

The visible facets would be due to the structure of the output - each facet is probably being described with independent coordinates (for example 2 adjoining rectangular facets = 8 vertices, rather than 6 vertices). I’ve thought about checking for such vertices but I think that doing so in general would impose a huge calculation expense. Who knows - I might implement such a thing one day, but it’s somewhere at the very bottom of my growing list of priorities.

@maui, can this tessellation factor have a modificator that will make less tessellation for small radii and higher tessellation for bigger radii for one part?
The edge of an IC can easily work with just 2-3 segments (better than just a simple chamfer) and the housing of a alu cap could use like 6 or more to look good.
But sometimes one has got large and small round surfaces in the same model…
Would that be possible - a context sensitive tessellation setting that works on the fly?

@kammutierspule
The MELF is pretty bad, my apologies. It consist of the opaque parts and the clear cylinder… I’ll try to work on it again to see what I can do.
Inventor allows me to create separate parts when I tell it to, otherwise it will ‘fuse’ them together on export I believe - not sure on this.
Will need some experimentation…

Here is the workflow for the MELF:

  • 2 rectangular shapes rotated around an axis
  • roundinfg of the edges (Fillet)

  • rectangular shape for inside the glass body
  • more complicated, free floating (no intersection with existing parts or other shapes) shape for glass body itself (otherwise I can’t set it to transparent, need to play with that more)

I could also output single sided faces/surfaces by the revolution tool, but @maui did mention problems with those surfaces in VRML/STEP?

[EDIT]
I did play a bit with the model and made a version with surfaces for the glass and the marker ring, the glass body intrudes into the solid body in Inventor, where as the marker is free floating.
It’s also 4 segments per 90 deg arc, didn’t use @maui’s new export script yet for this.

MELF_test.stp (24.0 KB)
MELF_test.wrl (95.5 KB)

IMHO, the big radius could use 2 more segments, as where the edges could do with 1-2 less, the smaller definitely.

[EDIT2]
now if somebody could tell me where I could adjust the specular/shininess of the materials in FreeCAD?
They don’t seem to push through, might already be missing in the STEP model that comes from Inventor.
So, where do I put my finger to make them shiny?

No problem that is a learning process :slightly_smiling:
I know that modeling for CAD is very different for modeling to artistic proposes (movies, games… ) … thats is why there are also different softwares for modeling with different proposes.
So probably you have to play and investigate a bit what are the best way to get valid CAD models and that they export good for mesh triangles.

For example, why are you creating the caps with a rotate rectangular arround an axis…etc
Isn’t that easier to just make a caped cylinder and smooth the edges?!
I hope it is possible to create / model non-solid surfaces?

The new model looks better… also notice that the render are able to better smooth the normals and you don’t see that “bands” like the other before…

For a latter stage, after you have sure you have good VRML models, we should have a look at the MeshLab application:
http://meshlab.sourceforge.net/

It can import and export VRMLs and it may help improve the final file (eg: remove duplicate vertex… etc… )

the STEP model in FC is not fused… so it is a problem for MCAD exporting
I would stay on the old model, doing the export with the new macro. view3dscene is not arguing about anything with that model…
I really don’t understand all these issues on that nice library models :confused:

Mixing up all sw and sources will just create a lot of confusion… still get very :confused:

for MCAD library models FreeCAD is the only reference I consider and that is fully compatible with the exporting process… so please don’t move from that guide line…

that is exactly what has not to be done for a correct MCAD exporting, in terms of FreeCAD integration…
please don’t suggest any MCAD approach before having that tested on the MCAD exporter…

Afaik there are no simple bodies to start with in Inventor… I know them from 3D Max for solid body modelling (3D Max is mesh based) and I’ve seen this approach in FreeCAD.
Even in FreeCAD I’d try to do it without primitives as I would be more flexible. A little change in the sketch and the revolved shape/surface will adjust - can’t do that with a primitive - or better, I would need to think much more before modeling with primitives and rely even more on boolean operations.
Inventor has got primitives for NURBS modelling, but that’s another can of worms and not relevant here.

@maui
The STEP models will stay as they are, except for the surfaces, if those would be working.
I’m as @kammutierspule interested in less heavy VRML models for KiCAD as long as that is needed. 2.4MB for a MELF is a bit over the edge… the one up there with 96kB is reasonable. Also one is usually 4-5 device sizes away from them while looking at them - no one will notice the low res on a MELF with like 6 segments per 90 deg arc from that distance on a computer screen.
Once you go and involve StepUP and use those STEP models in Blender & Co they will be smooth again - so no worries.
A simple board of mine with like 50 devices I made in VRML needs 12 seconds to load in the 3D viewer in KiCAD… not very sexy. I can also hear the fan of the GPU turn up once I orbit the board around…

with the new FreeCAD VRML Macro the VRML models are 1/19 times
here the VRML models coming from your nice MELF and MELF_MINI STP model
MELF.wrl (131.2 KB)
MELF_MINI-001.wrl (124.6 KB)
MELF_MINI.wrl (129.7 KB)
MELF-001.wrl (207.4 KB)
MELF.stp (29.9 KB)
MELF_MINI.stp (29.3 KB)

1 Like

@maui This is your (and @Joan_Sparky) work, I am just giving my suggestions and hints based on my perspective. Since there is no official guidelines or forced policies to make 3D models for KiCad, in the end it is up to artists what they provide in their libraries (and what KiCad can support)

One of the things I am trying to illustrate here is the different between modeling for a CAD or modeling something for a 3D engine. While modeling for a CAD you are thinking in mechanical aspects correctness, when creating a model to be render by a 3D engine you think “how does the engine handles my triangles” so you will think how it will look in the end and how much I can optimize my model to be render nice and fast on the engine.

So my feedback here is just, from a technical and personal perspective “how good are your models to be rendered / handled with KiCad 3D engine”

So its up to you! :wink:

1 Like

impressive, I’m convinced… no ‘real’ change needed :slightly_smiling:
@kammutierspule I’ll use the tessellation option of the new script and see how I go as it’s probably not needed to go as extreme as I did with the test MELF up there.

What’s with the 001 models… look like the mini’s. Anything I miss?

Btw… any idea how I could automate these settings modifications with your script?

It would need to find all materials that the models uses and adjust them according to marios material reference?

I used 0,01 tessellation factor

it is possible to read these values in FC only for non fused models (fine for your models, not for e.g. models coming from on-line libs)
these are the references values
FreeCAD.ActiveDocument.ActiveObject.ViewObject.ShapeMaterial.AmbientColor FreeCAD.ActiveDocument.ActiveObject.ViewObject.ShapeMaterial.EmissiveColor FreeCAD.ActiveDocument.ActiveObject.ViewObject.ShapeMaterial.Shininess FreeCAD.ActiveDocument.ActiveObject.ViewObject.ShapeMaterial.SpecularColor

you can add those values then in the macro adding them after the part
f.write("appearance Appearance{material Material{diffuseColor %f %f %f\n" % shape_col)
or you can just force them to the values you need

to be honest I have not a big interest in material properties, because they are not very valuable when loaded in professional rendering sw (e.g. Blender), where texture props are much more important for a real realistic aspect…

keep in touch
Maurice :smiley:

so please have a look at the 3D MCAD exporter and spend a little time with the models and FreeCAD (latest version) and the latest FC VRML Macro before spend time in aspects I considered already outdated, as we already have discussed in our recent mail conversations

I will have a look latter on that new MELFs that you posted.

Which aspects are outdated that we discussed before?

you asked here to modify the FC VRML models that were generated from FC standard ‘internal’ exporting routine, when you knew (as you tested and you gave me positive feedback in our mail conversations) of the new exported models;
so that is just working on outdated problem IMO
Cheers
Maurice