I think it depends. May be ok for corners. But may be too low for big cylinders, eg: cylindrical capacitors.
Relating with the smooth of the normals, that depends on the tessellation generator and on the normal calculation (smooth) of the render(in case it don’t use the normals that come with the model)
But there is not much you can do about it, unless there are proper options in the triangle convertion
@Joan_Sparky
don’t loose too much time on that …with a friend of mine we have already solved that, exporting the VRML without the internal FC routines, but building the VRML with a python parser…
you can find the VRML exporter at the official FreeCAD Macro recipes at http://www.freecadweb.org/wiki/index.php?title=Macros_recipes
and here the macro http://www.freecadweb.org/wiki/index.php?title=Macro_PartToVRML
I think you would appreciate it a lot … 5 times smaller in bite size typically, and with a simpler VRML structure, so to be read also from Blender…
and you can choose the tessellation factor
I’m going to release the new GUI version of kicad StepUp that is using the new routines…
for the moment here an example of the Blender rendering (plain VRML without material properties)
@kammutierspule
considering that now you can have nice and small VRML models to test the new 3D rendering, would you mind to see if you can implement the ability to move the rotation center in 3d viewer?
Me and a lot of people working with large board and enclosure would appreciate it a lot
One thing is the result format of the VRML and “file cleanness” (your new exporter)
Other is the tessellation. Having a very high tessellation may doesnt help the render and user will not gain in visualization quality. Also if you have a very high tessellation, that will make the renders slow.
That example of the MELF have about 27584 triangles.
Just gave you an idea, that is about the polycount of a main character in a actual video game:
So if you have a board with 100s of that model… that will be lots of triangles in a scene…
Users will start to fell it slow in big projects.
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…
@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
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…
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.
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
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…
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
Mixing up all sw and sources will just create a lot of confusion… still get very
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…
@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”
impressive, I’m convinced… no ‘real’ change needed @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 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…