# Removing all surfaces in the X-Y Plane

11 messages
Open this post in threaded view
|

## Removing all surfaces in the X-Y Plane

 Dear all,I am an inexperienced OpenSCAD user. I would like to prepare an STL file for a 2D simulation in OpenFOAM using cfMesh's cartesian2DMesh generator (if you can suggest a workflow I would appreciate it). Whats is needed is a ribbon surface that represents the out-of-plane extrude. This means that if my 2D simulation has the Z-axis as the out-of-plane axis, then I need to have the X-axis direction on all surfaces. My geometry is simple I create a union of a couple of cubes. How can I then remove the X-Y plane surfaces of the union. I would like to avoid inputting the points with their coordinates directly to reduce overhead calculations and maintain things parametric. So if you know the magic trick, I would really appreciate it!Best regards,Hisham  _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Removing all surfaces in the X-Y Plane

Open this post in threaded view
|

## Re: Removing all surfaces in the X-Y Plane

Open this post in threaded view
|

## Re: Removing all surfaces in the X-Y Plane

 Hi guys, Thanks a lot for your quick response. I am sorry for struggling to explain myself. If you consider page 4 of this document http://cfmesh.com/wp-content/uploads/2015/09/User_Guide-cfMesh_v1.1.pdf I would like to turn a volume enclosed shape like Fig. 5 into a hollow shape like Fig.4. Because all side surfaces are X-Y plane surfaces, I thought it might be a useful condition. I think projection may not be the optimum solution but it is nice to know this capability. I produce a union of several cubes: union(){     translate(v=[-6, -0.1, -0.005]){         cube(size=[21, 0.2, 1.01]);     };     translate(v=[0, 0.1, -0.005]){         cube(size=[0.2, 3.0, 1.01]);     };     translate(v=[-5.0, 3.1, -0.005]){         cube(size=[10, 10, 1.01]);     }; }; And would like to export only the outer surface and delete the front and back surfaces! Best regards, Hisham -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Removing all surfaces in the X-Y Plane

Open this post in threaded view
|

## Re: Removing all surfaces in the X-Y Plane

Another option that might be even easier is to use the Inkscape (free, multi-platform) svg editor with the Path to OpenSCAD extension installed.

It has a somewhat documented feature in that an open path generates a user-specified wall thickness line rather than an enclosed polygon/path. This means that if you create a path such as in figure 4 but don't close the end, merely overlap the lines, then use the extension to create an OpenSCAD output, it will be identical to figure 4. Because of the user-specified wall thickness, it's still a 3-dimensional object.

The creator of the extension states that he will not be supporting/developing the extension, as it is native in the newest version of Inkscape. This would require the process to be changed within Inkscape to offset the original drawing to create the "thin-wall" extrusion.

Of course if a thin wall is unacceptable, the real answer remains Meshmixer.

Another work flow option in Meshmixer is to use the Edit/Plane Cut feature and select No Fill, then slice away the top and bottom of the envelope. It's a good bit faster for those shapes which permit entire planes to be vaporized.

The suggestion for Meshmixer was one that popped into my alleged mind too, as the methodology described is spot on.

On Wednesday, January 8, 2020, 7:27:50 AM EST, Alex Gibson <[hidden email]> wrote:

Hi Hisham, that makes sense.

So you're trying to remove the top and bottom face of an STL, leaving the
sides intact, deliberately producing a non-manifold object.

If you're trying to do this as a one-off, the quickest way is to download
'meshmixer', open the exported STL file from OpenSCAD, select the triangles
on the surfaces you don't want and hit delete.

If you need to do this for a batch of files and make a workflow, you could
use this:  https://www.thingiverse.com/thing:62666

It's an STL file to OpenSCAD converter - takes an STL mesh and turns it into
an OpenSCAD code polygon.  You could then edit that polygon to remove all
the faces where all points are on the same Z height (IE they are flat on the
XY plane).  Not sure if it will produce an error if you try to render the
STL as it will certainly be non-manifold, but if it works it's highly
reproducible...

Cheers,

Alex Gibson

_______________________________________________
[hidden email]
Open this post in threaded view
|

## Re: Removing all surfaces in the X-Y Plane

Open this post in threaded view
|

## Re: Removing all surfaces in the X-Y Plane

 Dear all, Thanks a lot for all your help and support and congratulations on this really active community spirit. It is in fact the motivation behind using OpenSCAD to use it inside Python scripts to automate preprocessing. I even use openpyscad which to my experience does not support the projection method (not bad, I can still make and call an openScad script if needed). Using an external tool manually will kill the purpose of the whole thing. I am currently considering planning to use Python's meshio library to conviniently read the stl file, filter points with z>0 and consider only surfaces with verticies only from the remaining points, rewrite as stl or some other format. Theoretically this should work but you all know how these things go south in reality :D So thanks again to all! Best regards, Hisham   -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Removing all surfaces in the X-Y Plane

 Sorry .. Just came tired from work! Of course I will remove surfaces based on surface normal or use a utility from cfMesh that produces the surface I need from an X-Y planar sketch ... This is maybe why both ideas got mixed in my head! -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org