Towards STEP components

Hi all,

Some may remember the topic about STEP files. Unfortunately, OpenSCAD being entirely mesh based doesn’t give nice solid object in a STEP file that can then be adapted in other CAD.

I have found a nice video that explains some methods for editing stl files.

Simple example:

If we take the electronics drawer and import it into FreeCAD we get this:

A somewhat uneditable object, but if use the “Part” workbench. And select from the menu, Part->Create shape from mesh. Then select the “Sew shape” tick in the popup and click next we now have this monstrosity:

Not the progress we were perhaps hoping for? However, by next selecting Part->Create a copy->Refine shape, we start are able to combine all the triangles on the flat surfaces:

Now we are starting to get somewhere! We still have a lot of triangles for anything that is curved. Before we go any further we need to. Create a solid with Part->Convert to solid.

At this point we could export the STEP file in a more useable state. Or in FreeCAD we can go to the “Part Design” workbench, and move the solid into a body. We can then play around doing some cuts and extrudes.

For example it isn’t too much work to convert the mounting points at the front into real cylinders. This can be done by making a sketch of some circles off 3 points on the mesh, cutting away the existing mount, extruding the circles (before pocketing the screw holes back through). As you can see we can now select the cylindrical face.

What about the main body?

This process doesn’t work for the main body. There are a number of mesh issues we hit with the microscope. The mesh analysis tool in FreeCAD actually makes a mess of repairing them. Even if I use ADMESH to fix the STL first FreeCAD still claims that there are a lot of mesh problems, even when ADMESH says there are none:

I think if we can get past these mesh problems we can do something similar for the main body, this would make it much easier for people to adapt the design for their needs.

5 Likes

That is interesting. Does the FreeCAD interface actually give us useful information to help to find the original cause of the mesh errors by showing where they are in yellow/red?

Thanks very much for this - I think a lot of people will appreciate that tutorial, including me :slight_smile:

Yes. The yellow and red bits are the errors. You can also turn off wither it displays the different error types. To work out what type of error it is. I think we also need to know why admesh thinks there are no errors after fixing, yet FreeCAD thinks there are errors.

2 Likes

Why do this when FreeCAD can import OpenSCAD source files and generate STEP files directly?

The problem is we make extensive use of minkowsi and hull operations which are not supported in the OpenSCAD extension as there is no direct equivalent in the underlying OpenCASCADE kernel. As such the items tend to still come in as a mesh. Very complex components like the main body tend to have problems.

But you make a good point that I haven’t tired this with some of the other less complex components, like this drawer.

Hello, is there anyplace so far where I can find the .STL files. A lot of people like me is not versed on openscad and we really want interact with files in CAD envirements familiar to us, like autofusion and stuff like that, but for us is really hard to work in the scad original files.

Hi @HeberleyT. All of the STL files generated are available as a zip download from the customisations and alternatives tab of the instructions.

1 Like

They are in the instructions:

All STLs for the high res version can be downloaded from this page:
https://build.openflexure.org/openflexure-microscope/v7.0.0-beta1/high_res_microscope/printing.html
For the Low Cost version from this page:
https://build.openflexure.org/openflexure-microscope/v7.0.0-beta1/low_cost_microscope/printing.html
For the upright version from this page:
https://build.openflexure.org/openflexure-microscope/v7.0.0-beta1/upright-microscope/printing.html

Then everything including extras for customisation are in this zip file.