discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

autodesk meshmixer

D
digital
Fri, Jan 16, 2015 3:33 PM

I used Autodesk meshmixer to slice an stl file into 2mm slices. Then I
exported the slice as an ascii stl file.

When I import into openscad, running F6 says there is "no top level geometry
to render"
F5 will show the geometry. I have also tried exporting from meshmixer as a
binary stl file but that doesn't work either.

layer2exp.stl http://forum.openscad.org/file/n11055/layer2exp.stl

Attached is the stl file.

--
View this message in context: http://forum.openscad.org/autodesk-meshmixer-tp11055.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I used Autodesk meshmixer to slice an stl file into 2mm slices. Then I exported the slice as an ascii stl file. When I import into openscad, running F6 says there is "no top level geometry to render" F5 will show the geometry. I have also tried exporting from meshmixer as a binary stl file but that doesn't work either. layer2exp.stl <http://forum.openscad.org/file/n11055/layer2exp.stl> Attached is the stl file. -- View this message in context: http://forum.openscad.org/autodesk-meshmixer-tp11055.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Fri, Jan 16, 2015 3:47 PM

On 01/16/2015 04:33 PM, digital wrote:

Checking the STL with Blender shows a number of different issues.
I guess the biggest problem would be: 4 non-manifold edges.

F5 can handle pretty much anything as it just displays the triangles,
but doing any CSG operation requires a solid model.

ciao,
Torsten.

On 01/16/2015 04:33 PM, digital wrote: > layer2exp.stl <http://forum.openscad.org/file/n11055/layer2exp.stl> > Checking the STL with Blender shows a number of different issues. I guess the biggest problem would be: 4 non-manifold edges. F5 can handle pretty much anything as it just displays the triangles, but doing any CSG operation requires a solid model. ciao, Torsten.
D
digital
Fri, Jan 16, 2015 3:58 PM

Hi Torsten,

Thank you for being a great supporter on this community

So, if I understand correctly, what you suggest is I need to get the
original 3d model file and use that instead of the stl?

--
View this message in context: http://forum.openscad.org/autodesk-meshmixer-tp11055p11057.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi Torsten, Thank you for being a great supporter on this community So, if I understand correctly, what you suggest is I need to get the original 3d model file and use that instead of the stl? -- View this message in context: http://forum.openscad.org/autodesk-meshmixer-tp11055p11057.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Fri, Jan 16, 2015 4:10 PM

On 01/16/2015 04:58 PM, digital wrote:

So, if I understand correctly, what you suggest is I need to get the
original 3d model file and use that instead of the stl?

Maybe that helps, I don't know. That meshmixer export is certainly
very much broken. It also has a hidden cylinder inside the visible
model, not sure how that should look like in the original model.

If you describe the whole workflow of what you are trying to do
(generating layers for laser cutting?), someone might have an idea
how to go a different route.

ciao,
Torsten.

On 01/16/2015 04:58 PM, digital wrote: > So, if I understand correctly, what you suggest is I need to get the > original 3d model file and use that instead of the stl? > Maybe that helps, I don't know. That meshmixer export is certainly very much broken. It also has a hidden cylinder inside the visible model, not sure how that should look like in the original model. If you describe the whole workflow of what you are trying to do (generating layers for laser cutting?), someone might have an idea how to go a different route. ciao, Torsten.
TP
Torsten Paul
Fri, Jan 16, 2015 4:19 PM

On 01/16/2015 04:47 PM, Torsten Paul wrote:

On 01/16/2015 04:33 PM, digital wrote:

Checking the STL with Blender shows a number of different issues.
I guess the biggest problem would be: 4 non-manifold edges.

Marius found some even worse problems with the STL. Looks like
meshmixer really had a bad day with that model. See the highlighted
edges from the screenshot: http://imgur.com/Pd9D1Z4
Those were not even flagged by blender, probably because it was too
confusing ;-).

ciao,
Torsten.

On 01/16/2015 04:47 PM, Torsten Paul wrote: > On 01/16/2015 04:33 PM, digital wrote: >> layer2exp.stl <http://forum.openscad.org/file/n11055/layer2exp.stl> >> > Checking the STL with Blender shows a number of different issues. > I guess the biggest problem would be: 4 non-manifold edges. > Marius found some even worse problems with the STL. Looks like meshmixer really had a bad day with that model. See the highlighted edges from the screenshot: http://imgur.com/Pd9D1Z4 Those were not even flagged by blender, probably because it was too confusing ;-). ciao, Torsten.
D
digital
Fri, Jan 16, 2015 4:33 PM

Hi Torsten,

Generating layers for laser cutting is exactly what I'm trying to do.

Originally I was trying to use openscad as a slicer to export to dxf but, to
the best of my knowledge, openscad does not have an export dxf module nor
does it have the ability to determine the origin of an imported stl file.
Attached is the openscad slicer I was working on. I based it on the work of
Matthew Venn and clothbot.

This is what I tried openscad_slicer.scad
http://forum.openscad.org/file/n11060/openscad_slicer.scad
import stl -> slice in openscad -> export to dxf

so I'm trying an alternative work flow

import stl in autodesk meshmixer --> slice in meshmixer --> export each
sliced layer as an stl->

import sliced stl layer into openscad-> export as dxf

There is probably a better way to do this.

--
View this message in context: http://forum.openscad.org/autodesk-meshmixer-tp11055p11060.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi Torsten, Generating layers for laser cutting is exactly what I'm trying to do. Originally I was trying to use openscad as a slicer to export to dxf but, to the best of my knowledge, openscad does not have an export dxf module nor does it have the ability to determine the origin of an imported stl file. Attached is the openscad slicer I was working on. I based it on the work of Matthew Venn and clothbot. This is what I tried openscad_slicer.scad <http://forum.openscad.org/file/n11060/openscad_slicer.scad> import stl -> slice in openscad -> export to dxf so I'm trying an alternative work flow import stl in autodesk meshmixer --> slice in meshmixer --> export each sliced layer as an stl-> import sliced stl layer into openscad-> export as dxf There is probably a better way to do this. -- View this message in context: http://forum.openscad.org/autodesk-meshmixer-tp11055p11060.html Sent from the OpenSCAD mailing list archive at Nabble.com.
MK
Marius Kintel
Fri, Jan 16, 2015 4:41 PM

If you’re already using Autodesk tools, why not try 123D Make?
That is the sole purpose of that program; convert from 3D to lasercut slices.

If you want to do it in OpenSCAD, that shouldn’t be too hard, but as you cannot read the dimensions of an imported file, you’d have to input those dimensions somewhere. We do support saving to DXF though.

-Marius

If you’re already using Autodesk tools, why not try 123D Make? That is the sole purpose of that program; convert from 3D to lasercut slices. If you want to do it in OpenSCAD, that shouldn’t be too hard, but as you cannot read the dimensions of an imported file, you’d have to input those dimensions somewhere. We do support saving to DXF though. -Marius
TP
Torsten Paul
Fri, Jan 16, 2015 5:44 PM

There's not much need as OpenSCAD scripting to do slicing, pretty much
only 'file=""; projection(cut = true) translate([X, Y, -Z]) import(file);'
is needed to allow passing parameters from the command line.

See below for a simple STL to DXF converter using bash + admesh and a
couple of standard command line tools...

As there is currently no persistent cache, that's likely the slowest
slicer around :-).

ciao,
Torsten.


#!/bin/bash

Written by Torsten Paul, Published under CC0

FILE="$1"
LAYERHEIGHT="$2"

O=openscad

if [ ! -f "$FILE" -o -z "$LAYERHEIGHT" ]
then
echo "usage: $0 <stl-file> <layer-height>"
exit 1
fi

set -- $(admesh "$FILE" | grep ^Min | tr -d 'A-Za-z=,\r\n')

MINX=$1
MAXX=$2
MINY=$3
MAXY=$4
MINZ=$5
MAXZ=$6
echo "X: $MINX - $MAXX / Y: $MINY - $MAXY / Z: $MINZ - $MAXZ"

WIDTH=$(echo $MAXX - $MINX | bc)
DEPTH=$(echo $MAXY - $MINY | bc)
HEIGHT=$(echo $MAXZ - $MINZ | bc)
echo "WIDTH: $WIDTH / DEPTH: $DEPTH / HEIGHT: $HEIGHT"

TX=$(echo "( $MINX + $MAXX ) / -2.0" | bc)
TY=$(echo "( $MINY + $MAXY ) / -2.0" | bc)
echo "TX: $TX / TY: $TY"

LAYERS=$(echo "scale=3; a = ( $HEIGHT / $LAYERHEIGHT ) - 1; scale=0; 2*a/2" | bc)
echo "LAYERS: $LAYERS"

echo 'file=""; projection(cut = true) translate([X, Y, -Z]) import(file);' > slice.scad

for layer in $(seq 0 $LAYERS)
do
ZZ=$(echo "$MINZ + $layer * $LAYERHEIGHT + $LAYERHEIGHT / 2" | bc)
echo ; echo "* Generating layer $layer at $ZZ..."
"$O" -o "layer${layer}.dxf" -Dfile=""$FILE"" -DX=$TX -DY=$TY -DZ="$ZZ" slice.scad
done


There's not much need as OpenSCAD scripting to do slicing, pretty much only 'file=""; projection(cut = true) translate([X, Y, -Z]) import(file);' is needed to allow passing parameters from the command line. See below for a simple STL to DXF converter using bash + admesh and a couple of standard command line tools... As there is currently no persistent cache, that's likely the slowest slicer around :-). ciao, Torsten. ------------------------------------------------------------------- #!/bin/bash # Written by Torsten Paul, Published under CC0 FILE="$1" LAYERHEIGHT="$2" O=openscad if [ ! -f "$FILE" -o -z "$LAYERHEIGHT" ] then echo "usage: $0 <stl-file> <layer-height>" exit 1 fi set -- $(admesh "$FILE" | grep ^Min | tr -d 'A-Za-z=,\r\n') MINX=$1 MAXX=$2 MINY=$3 MAXY=$4 MINZ=$5 MAXZ=$6 echo "X: $MINX - $MAXX / Y: $MINY - $MAXY / Z: $MINZ - $MAXZ" WIDTH=$(echo $MAXX - $MINX | bc) DEPTH=$(echo $MAXY - $MINY | bc) HEIGHT=$(echo $MAXZ - $MINZ | bc) echo "WIDTH: $WIDTH / DEPTH: $DEPTH / HEIGHT: $HEIGHT" TX=$(echo "( $MINX + $MAXX ) / -2.0" | bc) TY=$(echo "( $MINY + $MAXY ) / -2.0" | bc) echo "TX: $TX / TY: $TY" LAYERS=$(echo "scale=3; a = ( $HEIGHT / $LAYERHEIGHT ) - 1; scale=0; 2*a/2" | bc) echo "LAYERS: $LAYERS" echo 'file=""; projection(cut = true) translate([X, Y, -Z]) import(file);' > slice.scad for layer in $(seq 0 $LAYERS) do ZZ=$(echo "$MINZ + $layer * $LAYERHEIGHT + $LAYERHEIGHT / 2" | bc) echo ; echo "* Generating layer $layer at $ZZ..." "$O" -o "layer${layer}.dxf" -Dfile="\"$FILE\"" -DX=$TX -DY=$TY -DZ="$ZZ" slice.scad done -------------------------------------------------------------------
D
digital
Fri, Jan 16, 2015 8:09 PM

Hi Kintel,

Thanks for the tip. I'll look into it.

I am having fun with openscad and I'd like to keep exploring it.

I take it openscad does not have an export dxf module and/or library?

--
View this message in context: http://forum.openscad.org/autodesk-meshmixer-tp11055p11063.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi Kintel, Thanks for the tip. I'll look into it. I am having fun with openscad and I'd like to keep exploring it. I take it openscad does not have an export dxf module and/or library? -- View this message in context: http://forum.openscad.org/autodesk-meshmixer-tp11055p11063.html Sent from the OpenSCAD mailing list archive at Nabble.com.
D
digital
Fri, Jan 16, 2015 8:35 PM

Hi Torsten,

Thanks for writing up that script. It may be slow but this is a good
learning experience for me.

I'm not an expert with the command line and I am using windows not linux.
How do I run that in windows cmd?

--
View this message in context: http://forum.openscad.org/autodesk-meshmixer-tp11055p11064.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi Torsten, Thanks for writing up that script. It may be slow but this is a good learning experience for me. I'm not an expert with the command line and I am using windows not linux. How do I run that in windows cmd? -- View this message in context: http://forum.openscad.org/autodesk-meshmixer-tp11055p11064.html Sent from the OpenSCAD mailing list archive at Nabble.com.