OpenScad > FreeCad > KiCad - Problem

Hi,

I have a problem with converting a model from OpenSCAD to KiCad via FreeCad. I save in OpenSCAD in .csg format. Load .csg in FreeCad and save it as .step. It works with a few details. Now the model is almost finished and in KiCad I only see a faulty model. If I engrave lettering on the side, the model is totally mutilated. I suspect a bug in FreeCad. But I don’t know exactly. If I load the .step file from FreeCad into Solid Edge Community, it is displayed just as incorrectly as in KiCad.

How can I get the model into KiCad without errors?
My KiCad version is up to date.
meinAlps_005_2.scad (6.0 KB)


Alps EM20B less details okay
AlpsEM20B more details wrong

Seems like you have an OpenSCAD or FreeCAD issue or a combination of the two.

Post the STEP file here and I’ll try and open it in SolidWorks if you want . . .

Hello,

that would be very nice of you.

.step - AP214

meinAlps_005_3.step … without invisible objects

meinAlps_005_3_with.step … with invisible objects

Thanks.

meinAlps_005_3_with.step (2.9 MB)
meinAlps_005_3.step (2.9 MB)

This is what they look like in SolidWorks . . .


and . . .


I guess this looks like surfaces from multiple (sub) objects at the same coordinates and which are interfering with each other due to things like rounding of floating point numbers and such.

1 Like

Hi,

looks just as faulty as I see it in KiCad.
If I leave out certain details, the model ends up being correct in .step format. With too many details, the transfer is overwhelmed somewhere.
If I engrave writing on the side, then nothing is correct in the .step format.
Too bad that OpenSCAD cannot output .stp itself.
I like the way the components are programmed.

@mikrocoder I looked at the posted STEP files… OMG!

These are about the worst Model’s I’ve seen in years - not so much in the ‘design’ approach (though, a better approach would have yielded a much better, efficient result) but, rather in the composite of the designed ‘features’ (Body’s and Part’s, in FreeCAD terms).

Example: Handful of items were Difference’d then, Unionized, though redundant, that’s fine, but, they were left in place afterwards and ‘that’ causes their Colors to Bleed with the same base-items (that is what @paulvdh is hinting at - color bleeding from items at the same position in space).

I started cleaning up the ‘with’ file but ran out of coffee so, I stopped. Below screenshot of some deletion’s (and item ‘hiding’). After cleaning a dozen items, I ‘Compounded’ them to yield a unified ‘item’ that does not Bleed… did not finish any of it, though. FreeCAD File attached for your inspection. If it were me and I needed to use one of these files, I’d go through the items in the Tree and ‘Hide/Show’ to see what’s going on then, select the necessary one’s and Compound them. When done, I’d select ONLY the ones comprising the resulted Compounds, Groups…etc and Export them. Don’t export all the items, that will cause Bleeding…

If you go through your STEP files, you can tweak to get a desired result and, ‘Learn’ something that will help you deal with similar STEP files.

Here’s my partially cleaned file…
woof.FCStd (564.1 KB)

Cubes get Difference’d then Unionized Thus, you would want to Hide all but the Unionized (hide or delete them… you decide…)
Screen Shot 2024-07-23 at 10.38.44

My ‘Unfinished’ cleaning shows No Bleeding and would yield a good STEP for use in Kicad.

Hi,

the model should look like the first picture at the top. Thanks for your advice. I will give it a try.

Followup…
• With respect to FreeCAD
• Different ways to accomplish models
• A Complete ‘Gizmo’ can contain multiple Parts and Bodys
• Often how it’s done depends on the Goal (thus, forehand Planning)
• Export of STEP files is dependent on the underlying item(s) including Compounding, Boolean, Fusing…etc
• Sometimes (depending on ‘way’ models were created) Coloring can be done as Appearance-color and/or Surface-color
• Creating a Model for Graphic Representation (i.e. Use in Kicad, can utilize Non-Functional approach)

Example of Non-Functional approach:
• Usage for Kicad and other Graphics need not worry about inner ‘Guts’ and details as shown in attached FreeCAD and exported STEP files.

The Model facilitates unrealistic, embedded features that make possible creating other features/Part/Body in a simple way.
Example(s): The Pins and Copper Pads are created (extruded) from an Inner Body, hidden by the surrounding Body. In other-words, Body-A is embedded in Body-B and below the surface. Thus accomplishing two things: No Bleeding and the ability to have multiple Pins, Pads as complete items (i.e., 20 Pins attached to inner disk is one item). The benefits of this approach eliminated fussing with so much to list…

The attached FreeCAD file (homeboy) was very quick to make and I did NOT do a complete job of it… No attempt to make a more realistic model - Just enough to enable your reviewing how to go about it…

If wanting to put Text on a Model, as simple way (about the only FreeCAD way) is using Shape-Strings. Here’s a link to one of my Video’s that does it toward the end…

homeboy.FCStd (171.9 KB)

FreeCAD screenshot

Two STEP files: One has Surface-Color (Blue). If both are Enabled in Kicad footprint, you see Bleeding.


Bleeding

1 Like

Hi,

thank you for your effort and explanations.
I did not create the model in FreeCad. I created it in OpenSCAD. This is more of a programming language similar to C, which I like very much. I like to have clear parameter entries instead of moving objects uncontrollably with the mouse. I had no idea that the conversion to .step would cause so many problems. :slight_smile:
Before I start with FreeCad, I would like to ask whether it might not make more sense to familiarize myself with Solid Edge Community? Or is that overkill?

All the 3D models in Kicad are made with FreeCAD using scripts.
FreeCAD is powerful and reliable for modelling manually or with scripts.

FreeCAD contains ‘Workbenches’ - these are, basically, embedded App’s (similar to Kicad’s having PCB/Schematic/Image-Convertor/…)
Thus, the Workbenches do different things and some have interface compatibility with other Workbenches such that a User can assemble Toolbars and populate them with Tools from other Workbenches. See screenshot

Part-Design Workbench (not ‘Part Workbench’) is the Workbench that parrots major CAD programs - thus, 80% commonality of what you already know is a solid foundation to FreeCAD success. Then, familiarity with other Workbenches happens quickly (Part, TechDraw, Draft - see screenshot of my default workbenches).

About the only real ‘Shortcoming’ with FreeCAD is ‘Text’ (strings) usage. But, once understanding how to use it’s ‘Shape-String’ tool, there are minimal limitations.

If you’re a CAD user, you can watch some FreeCAD videos and come up-to-speed quickly (these, my video’s assume CAD knowledge and with your knowledge, you might want to look at some of mine that relate to Kicad)

View>Panels>Python_Console, will get the Python console were you can code and see info, enter data… if desired.

Custom Toolbar it’s actually a Right-Side of screen toolbar rotated here for posting

My default Workbench’s

Hi,

Okay, thank you all for all the information and help. I’ll take a closer look at FreeCad. :smiley:

1 Like

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