Hi,
Is there a a generic like 1x1x1mm size block in the 3D library?
I have applied numerous shapes in the default library and cant find such a thing.
It would be really handy, because say one have 1x2x3mm sized component, then you could just scale the generic 1mm block by 1, 2, 3.
Similarly with a Cylinder. This would be really helpful.
One could even stack shapes up with the 3D model adder, which is quite powerful with its rotate, scale and offset functionality.
Has anyone created a 1x1x1mm grey block that they are willing to share?
Thanks so much that was exactly what I was looking for!
3D models now in a second!
I see I am not the first person to have this idea.
A simple search and replace “0.12156863” to “0.5” changes the black to a nice medium gray.
When I finish my current projects, I would like to learn how to make a cylinder, and then make a mini library of generic shapes/colours which I think would add a lot of value to none pros.
For cylinders it’s not so straightforward since larger cylinder = uglier model unless you put in many polygons.
If you only want rough models, KiCad has a number of IDF tools; here’s an example of using the tools to created an IDF model of the “pic_programmer” demo project which comes with kicad:
There is a script which generates the IDF outlines using the KiCad tools idfcyl and idfrect, and in some cases for more complex outlines the script defines the outline. I thought I had a rendering of that IDF model but I can’t find it; I have a rendering of the “video” demo though:
The IDF component outlines (*.idf files) are simply added to the project the way you would add a VRML model. However, scaling is not applied.
If you create and export an IDF model you can use KiCad’s idf2vrml tool to create those ugly multi-colored models. Alternatively you can use the idf2igs tool from the separate “libIGES” project to produce an IGES assembly with those ugly colors. The good thing about going through IDF (+ idf2igs if necessary) is that you get an actual mechanical model with round holes etc. In the past people used VRML export + long list of voodoo to create a mechanical model which didn’t have round holes (which is a nuisance when you want to make alterations to the model within an MCAD package).
Since the stable release, documentation of the IDF tools has been available in the kicad docs.
here the version of a 1x1x1 cube exported by FreeCAD (I used ‘Shaded’ before exporting otherwise you get also ‘Wireframes’ and ‘Vertex Points’ in vrml) _box-fc.wrl (5.6 KB)
and the kicad StepUp exported version box-fc-ksu.wrl (1.7 KB)
both are already scaled 1/2.54
Hi Maui, thanks for the file. I am still using kicad-stepup and its great. I used this generic box.wrl for all my missing parts, but when I use ki-cad-stepup I need a box.stp.
So I made one in freecad, a 1x1x1 box. I then attached it to a footprint, and scaled it in Kicad foot print properties, but when I run KiCad-stepup it always pulls in a 1x1x1 box instead of scaling to the required size.
Do you think my box.stp is the problem? Do you by any chance have a 1x1x1.stp file that gets scaled correctly?
The issue here is that you’re working with an MCAD system (FreeCAD/OCE) which generally do not scale things because they work with the units specified in the model file. In the mechanical world it really doesn’t make sense to allow arbitrary X/Y/Z scaling. So in kicad you can scale VRML models as you please, and scaling had to be permitted because the VRML specification does not enforce length units, but for any MCAD data including IDF outlines any scale parameters are ignored.
If you wish I can make modifications to the kicad->STEP converter (https://github.com/cbernardo/kicad2mcad) so that it will also interpret IDF outlines, but you will still need to create a script of some kind to create the different sized boxes that you need for a project. Personally I will never implement scaling of MCAD models because that introduces many more opportunities to make very expensive mistakes in the mechanical verification.
Hi @mangelozzi,
Kicad StepUp doesn’t even care about the scale parameters in wrl because normally in MCAD world the models have to be already in the right scale…
There is a configurable option to create a bounding box of 3D mechanical models, but at the moment kicad StepUp doesn’t support the feature you are asking for (which would be to make a parametric bounding box based on scale values from wrl) …
I’m going to think on develop this feature because it could be of some interest for kicad users (I remember that also @jwr was asking for something similar)
I’m adding some features to kicad StepUp (one is the ability to align part to footprint using constrains), so because I’m revisiting something in the code, may be I would get the chance to add also this feature…
keep in touch
Maurice
the feature to create boxes or cylinders using dimensions as in scale values of wrl model
This feature will be triggered only if the wrl models have the following names:
box_mcad.wrl
cylV_mcad.wrl
cylH_mcad.wrl
if the kicad StepUp tools will parse these special names, correspondent models will be generated in FreeCAD using the dimensions as per the scale values indicated in the kicad_pcb file.
the 3 special wrl models are in the “shapes” folder of the demo project, or just download them from here cylV_mcad.zip (2.8 KB) cylH_mcad.zip (2.7 KB) box_mcad.zip (407 Bytes)
that should add the ability to use simple generic shapes to generate bounding box like ECAD and MCAD models…
Please test it downloading the latest version of Kicad StepUp here https://sourceforge.net/projects/kicadstepup/files/latest/download
and give me a feedback if that fulfill your request
Oh my word maui you beast! Thank you so much! I have to be an adult and go to bed now, but I am so excited to try this out this weekend, brilliant idea and implementation!
Hi Maui,
So I just tried the new script, and it is fantastic! It is so easy to create 3D models now. Thank you very much!!! There was just one small issue, with the ferrite beads (FB1 and FB2), they were incorrectly placed in the Y axis (thought you may want to know about it):
Here is a comparison between the native display and the stepup model:
Boxes which were symmetric were placed fine, and even some rectangles were placed fine.
But the ferrite beads (x-scale:4.5, y-scale:1.6, z-scale:1.6) was not.
Still a really great helpful tool! Thank you so much!
@mangelozzi
I tested the ferrite and it is fine
as Mario noticed, you have problem with U2 and U3 models
I see you are not using StepUp models both for STP and WRL models…
in facts the dpack model has a different aspect in Kicad 3d-viewer and in MCAD
that is why you are having a shift in the two environments
The new release of kicad StepUp is taking in count also of wrl model offset and rotation (only scale is mandatory 1,1,1 unless the new _mcad box models)
Probably in your board and/or in your library kicad_mod you have wrong offset alignment…
just make a backup of your board and search for all the instances of (at (xyz
if you don’t have (at (xyz 0 0 0))
you need to change previous values to the above ones
It is a best way to use kicad StepUp inserting models both in STP and WRL coming from StepUp exporter tools. In that way not only position, but also look will be the same in both environments…
Moreover in the kicad StepUp demo you can find also STP and WRL models for dpack to252
here a small video explaining that
This is why I want the OCE plugin to be in KiCad (eventually) after Mario’s new 3DViewer is merged. Then you will only have the STEP model and there won’t be any surprises because STEP and VRML models have different offsets.
Hey Maui,
Well done on the work you have been doing.
Maybe just a weird little issue of using “box_mcad.wrl”… as you know it creates a .step model on the fly.
When I use it with an offset specified to get the .wrl model positioned correctly, then it makes the model offset. As you can see in the below image:
KiCad StepUp in FreeCAD:
Here you can see the connector boxs’ offset. The strange things is one of the boxes on the bottom side of the PCB is in the correct position (marked with a green tick). But the same component on the top side is in the wrong position (as shown in red).
I can use StepUp to correct the offsets manually every time I export the file. Just thought I would let you know because above it says it should handle offset and rotation data correctly. I am using the latest freecad version and almost latest KiCad StepUp (4022 but I see it has been updated 4 hours ago)(downloaded both of them today).
Hi @mangelozzi
To be honest I didn’t tested heavily offset for 3D boxes and cylinders… I’m not sure if the problem is on the script or on the base model…
do you have a board with wrong behavior to test it? (just a basic sample or a board without traces/netlist) EDIT: I tried with some offset and it seems to work… a non working example would help
the latest release has been updated mainly to allow multi-parts (using compounds) and edge tolerance on vertexes…