discuss@lists.openscad.org

OpenSCAD general discussion

View all threads

Changing an .stl file to .scad format

CM
charles meyer
Sun, Aug 29, 2021 7:44 PM

H all,

As both a newbie and a non-regular user of OpenSCAD I'm trying to master
some of the modifying techniques.

I found a 3D file on Thingiverse.

This is the 3D print.

Thingiverse. https://www.thingiverse.com/thing:3131119

I don't see any file offered by the creator that's in .scad format; just
.stl and .3mp

Must I use another application to first convert the .stl into .scad format?

Is there a way to change the width settings  in OpenSCAD from millimeters
to inches?

Thank you!

H all, As both a newbie and a non-regular user of OpenSCAD I'm trying to master some of the modifying techniques. I found a 3D file on Thingiverse. This is the 3D print. Thingiverse. https://www.thingiverse.com/thing:3131119 I don't see any file offered by the creator that's in .scad format; just .stl and .3mp Must I use another application to first convert the .stl into .scad format? Is there a way to change the width settings in OpenSCAD from millimeters to inches? Thank you!
BB
Bruno Boettcher
Sun, Aug 29, 2021 8:11 PM

Hello
Got this as a private mail ?

Anyway, you can include stl in openscad, but as stl (not very efficient)
there's No converter
as stl is a mesh description and scad  geometry....

For a simple design as that one, its easy and fast to redraw natively in
openscad....

Ciao

Bruno Böttcher

35 rue de la république, FR-67270 Schwindratzheim
email: bboett@adlp.org, mobile:bboett@gmail.com
Mob:+33 6 76 55 82 68

Dev: Java/Perl/PHP OS:GNU/LINUX, Android

charles meyer reachmeplace@gmail.com schrieb am So., 29. Aug. 2021, 21:41:

H all,

As both a newbie and a non-regular user of OpenSCAD I'm trying to master
some of the modifying techniques.

I found a 3D file on Thingiverse.

This is the 3D print.

Thingiverse. https://www.thingiverse.com/thing:3131119

I don't see any file offered by the creator that's in .scad format; just
.stl and .3mp

Must I use another application to first convert the .stl into .scad format?

Is there a way to change the width settings  in OpenSCAD from millimeters
to inches?

Thank you!


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Hello Got this as a private mail ? Anyway, you can include stl in openscad, but as stl (not very efficient) there's No converter as stl is a mesh description and scad geometry.... For a simple design as that one, its easy and fast to redraw natively in openscad.... Ciao Bruno Böttcher -- 35 rue de la république, FR-67270 Schwindratzheim email: bboett@adlp.org, mobile:bboett@gmail.com Mob:+33 6 76 55 82 68 ------------------------------------------------- Dev: Java/Perl/PHP OS:GNU/LINUX, Android charles meyer <reachmeplace@gmail.com> schrieb am So., 29. Aug. 2021, 21:41: > H all, > > As both a newbie and a non-regular user of OpenSCAD I'm trying to master > some of the modifying techniques. > > I found a 3D file on Thingiverse. > > This is the 3D print. > > Thingiverse. https://www.thingiverse.com/thing:3131119 > > I don't see any file offered by the creator that's in .scad format; just > .stl and .3mp > > Must I use another application to first convert the .stl into .scad format? > > Is there a way to change the width settings in OpenSCAD from millimeters > to inches? > > Thank you! > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
DM
Douglas Miller
Mon, Aug 30, 2021 12:02 PM

Must I use another application to first convert the .stl into .scad
format?

This is not possible. You are asking to convert a cake (the .stl file)
into the recipe for making it (the .scad file).

Is there a way to change the width settings in OpenSCAD from
millimeters to inches?

This also is not possible -- and IMHO it /shouldn't/ be. Speaking as a
fellow American, it's way past time that all of us in the US catch up
with the 19th century and learn how to use the metric system. The US is
literally one of only three countries in the world (the other two being
Liberia and Burma) that still use feet and inches, pounds and ounces,
gallons and quarts. All the rest of the world measures things in meters,
kilograms, and liters. And it's costing our economy billions of dollars
every year.

On 8/29/2021 3:44 PM, charles meyer wrote:

H all,

As both a newbie and a non-regular user of OpenSCAD I'm trying to
master some of the modifying techniques.

I found a 3D file on Thingiverse.

This is the 3D print.

Thingiverse.https://www.thingiverse.com/thing:3131119
https://www.thingiverse.com/thing:3131119

I don't see any file offered by the creator that's in .scad format;
just .stl and .3mp

Must I use another application to first convert the .stl into .scad
format?

Is there a way to change the width settings  in OpenSCAD from
millimeters to inches?

Thank you!

> Must I use another application to first convert the .stl into .scad > format? This is not possible. You are asking to convert a cake (the .stl file) into the recipe for making it (the .scad file). > Is there a way to change the width settings in OpenSCAD from > millimeters to inches? This also is not possible -- and IMHO it /shouldn't/ be. Speaking as a fellow American, it's way past time that all of us in the US catch up with the 19th century and learn how to use the metric system. The US is literally one of only three countries in the world (the other two being Liberia and Burma) that still use feet and inches, pounds and ounces, gallons and quarts. All the rest of the world measures things in meters, kilograms, and liters. And it's costing our economy billions of dollars every year. On 8/29/2021 3:44 PM, charles meyer wrote: > H all, > > As both a newbie and a non-regular user of OpenSCAD I'm trying to > master some of the modifying techniques. > > I found a 3D file on Thingiverse. > > This is the 3D print. > > Thingiverse.https://www.thingiverse.com/thing:3131119 > <https://www.thingiverse.com/thing:3131119> > > I don't see any file offered by the creator that's in .scad format; > just .stl and .3mp > > Must I use another application to first convert the .stl into .scad > format? > > Is there a way to change the width settings  in OpenSCAD from > millimeters to inches? > > Thank you!
J
jon
Mon, Aug 30, 2021 12:18 PM

I am not sure why you want to change the STL into SCAD format. Do you
want to modify it?  The object is very simple: you can design it
yourself in OpenSCAD fairly easily.

When I need to design something in inches, I create the object in
OpenSCAD and the do a scale(25.4).  Pretty simple

Jon

On 8/29/2021 3:44 PM, charles meyer wrote:

H all,

As both a newbie and a non-regular user of OpenSCAD I'm trying to
master some of the modifying techniques.

I found a 3D file on Thingiverse.

This is the 3D print.

Thingiverse.https://www.thingiverse.com/thing:3131119
https://www.thingiverse.com/thing:3131119

I don't see any file offered by the creator that's in .scad format;
just .stl and .3mp

Must I use another application to first convert the .stl into .scad
format?

Is there a way to change the width settings  in OpenSCAD from
millimeters to inches?

Thank you!


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I am not sure why you want to change the STL into SCAD format. Do you want to modify it?  The object is very simple: you can design it yourself in OpenSCAD fairly easily. When I need to design something in inches, I create the object in OpenSCAD and the do a scale(25.4).  Pretty simple Jon > On 8/29/2021 3:44 PM, charles meyer wrote: >> H all, >> >> As both a newbie and a non-regular user of OpenSCAD I'm trying to >> master some of the modifying techniques. >> >> I found a 3D file on Thingiverse. >> >> This is the 3D print. >> >> Thingiverse.https://www.thingiverse.com/thing:3131119 >> <https://www.thingiverse.com/thing:3131119> >> >> I don't see any file offered by the creator that's in .scad format; >> just .stl and .3mp >> >> Must I use another application to first convert the .stl into .scad >> format? >> >> Is there a way to change the width settings  in OpenSCAD from >> millimeters to inches? >> >> Thank you! > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
T
trygve@totallytrygve.com
Mon, Aug 30, 2021 12:53 PM

Hi!

This is... practically impossible.

A .STL is a collection of points and surfaces that makes up an object.

But a .SCAD file is a collection of objects and transformations of those that ends up as a 3D object that you can export a .STL from.

There's no way of 'tracing back' to find out how it was constructed.
The best we could hope for is to generate a big, ugly Polyhedron from it.
And that would be almost as impossible to edit as the .STL itself.
(Curved surfaces or circular ones are made up of very small triangles, so there are thousands on just that chip )

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#polyhedron

I don't know if there's a limit to the number of faces or coordinates in a Polyhedron, but I would expect there to be one.

So, technically possible, but no one is daft enough to try...

Trygve

Den 29. august 2021 kl. 21.44.25 +02.00 skrev charles meyer reachmeplace@gmail.com:

H all,

As both a newbie and a non-regular user of OpenSCAD I'm trying to master some of the modifying techniques.

I found a 3D file on Thingiverse.

This is the 3D print.

Thingiverse.https://www.thingiverse.com/thing:3131119

I don't see any file offered by the creator that's in .scad format; just .stl and .3mp

Must I use another application to first convert the .stl into .scad format?

Is there a way to change the width settings in OpenSCAD from millimeters to inches?

Thank you!


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Hi! This is... practically impossible. A .STL is a collection of points and surfaces that makes up an object. But a .SCAD file is a collection of objects and transformations of those that ends up as a 3D object that you can export a .STL from. There's no way of 'tracing back' to find out how it was constructed. The best we could hope for is to generate a big, ugly Polyhedron from it. And that would be almost as impossible to edit as the .STL itself. (Curved surfaces or circular ones are made up of very small triangles, so there are thousands on just that chip ) <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#polyhedron> I don't know if there's a limit to the number of faces or coordinates in a Polyhedron, but I would expect there to be one. So, technically possible, but no one is daft enough to try... Trygve Den 29. august 2021 kl. 21.44.25 +02.00 skrev charles meyer <reachmeplace@gmail.com>: > H all, > > As both a newbie and a non-regular user of OpenSCAD I'm trying to master some of the modifying techniques. > > I found a 3D file on Thingiverse. > > This is the 3D print. > > Thingiverse.<https://www.thingiverse.com/thing:3131119> > > > I don't see any file offered by the creator that's in .scad format; just .stl and .3mp > > Must I use another application to first convert the .stl into .scad format? > > Is there a way to change the width settings in OpenSCAD from millimeters to inches? > > Thank you! > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to <discuss-leave@lists.openscad.org> >
GM
Gregory Miller
Mon, Aug 30, 2021 1:04 PM

I have used the following successfully to transfer an STL to OpenSCAD.

http://www.aggregate.org/MAKE/TRACE2SCAD/

Gregory

From: trygve@totallytrygve.com trygve@totallytrygve.com
Sent: Monday, August 30, 2021 7:53 AM
To: OpenSCAD general discussion discuss@lists.openscad.org
Subject: [OpenSCAD] Re: Changing an .stl file to .scad format

Hi!

This is... practically impossible.

A .STL is a collection of points and surfaces that makes up an object.

But a .SCAD file is a collection of objects and transformations of those that ends up as a 3D object that you can export a .STL from.

There's no way of 'tracing back' to find out how it was constructed.

The best we could hope for is to generate a big, ugly Polyhedron from it.

And that would be almost as impossible to edit as the .STL itself.

(Curved surfaces or circular ones are made up of very small triangles, so there are thousands on just that chip )

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#polyhedron

I don't know if there's a limit to the number of faces or coordinates in a Polyhedron, but I would expect there to be one.

So, technically possible, but no one is daft enough to try...

Trygve

Den 29. august 2021 kl. 21.44.25 +02.00 skrev charles meyer <reachmeplace@gmail.com mailto:reachmeplace@gmail.com >:

H all,

As both a newbie and a non-regular user of OpenSCAD I'm trying to master some of the modifying techniques.

I found a 3D file on Thingiverse.

This is the 3D print.

Thingiverse.  https://www.thingiverse.com/thing:3131119 https://www.thingiverse.com/thing:3131119

I don't see any file offered by the creator that's in .scad format; just .stl and .3mp

Must I use another application to first convert the .stl into .scad format?

Is there a way to change the width settings  in OpenSCAD from millimeters to inches?

Thank you!


OpenSCAD mailing list

To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org

I have used the following successfully to transfer an STL to OpenSCAD. http://www.aggregate.org/MAKE/TRACE2SCAD/ Gregory From: trygve@totallytrygve.com <trygve@totallytrygve.com> Sent: Monday, August 30, 2021 7:53 AM To: OpenSCAD general discussion <discuss@lists.openscad.org> Subject: [OpenSCAD] Re: Changing an .stl file to .scad format Hi! This is... practically impossible. A .STL is a collection of points and surfaces that makes up an object. But a .SCAD file is a collection of objects and transformations of those that ends up as a 3D object that you can export a .STL from. There's no way of 'tracing back' to find out how it was constructed. The best we could hope for is to generate a big, ugly Polyhedron from it. And that would be almost as impossible to edit as the .STL itself. (Curved surfaces or circular ones are made up of very small triangles, so there are thousands on just that chip ) https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#polyhedron I don't know if there's a limit to the number of faces or coordinates in a Polyhedron, but I would expect there to be one. So, technically possible, but no one is daft enough to try... Trygve Den 29. august 2021 kl. 21.44.25 +02.00 skrev charles meyer <reachmeplace@gmail.com <mailto:reachmeplace@gmail.com> >: H all, As both a newbie and a non-regular user of OpenSCAD I'm trying to master some of the modifying techniques. I found a 3D file on Thingiverse. This is the 3D print. Thingiverse. <https://www.thingiverse.com/thing:3131119> https://www.thingiverse.com/thing:3131119 I don't see any file offered by the creator that's in .scad format; just .stl and .3mp Must I use another application to first convert the .stl into .scad format? Is there a way to change the width settings in OpenSCAD from millimeters to inches? Thank you! _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org <mailto:discuss-leave@lists.openscad.org>
JB
Jordan Brown
Mon, Aug 30, 2021 3:37 PM

On 8/29/2021 12:44 PM, charles meyer wrote:

Is there a way to change the width settings  in OpenSCAD from
millimeters to inches?

OpenSCAD is unitless.  There's nothing that says whether the units are
millimeters, inches, or furlongs.  Similarly, STLs are unitless.

Indeed, most people treat OpenSCAD units and STL units as millimeters,
but that's a matter of how consuming programs use them.

Apparently some people generate STLs where the units are intended to be
inches, because some slicers will detect very small models and suggest
that they might be in inches.

So there are three answers to your question:

1)  Treat OpenSCAD units as millimeters, and wrap a "scale(25.4)" around
your model so that you can design the bulk of it in inches.
2)  Treat OpenSCAD units as inches, and have your slicer scale.
3)  Treat OpenSCAD units as millimeters, and design in millimeters.

I try to design in millimeters, but many years of habits make that
hard.  When I design in inches, I define a variable "inch" with a value
of 25.4, so that I can say, e.g., "12inch".  Why do I do that, instead
of using scale()?  Because the measurements on the printer - layer
height, extrusion width - are in millimeters, and so when I need to do
stuff where the printer's resolution matters I want to be able to drop
into metric.  A lot of my work is on scale models, so I often set "inch"
to 1 for my 1:25.4 scale, and then I can use "3
inch" to mean three
scale inches, and use bare numbers where I need to get special effects
down around the printer resolution.

On 8/29/2021 12:44 PM, charles meyer wrote: > Is there a way to change the width settings  in OpenSCAD from > millimeters to inches? OpenSCAD is unitless.  There's nothing that says whether the units are millimeters, inches, or furlongs.  Similarly, STLs are unitless. Indeed, most people treat OpenSCAD units and STL units as millimeters, but that's a matter of how consuming programs use them. Apparently some people generate STLs where the units are intended to be inches, because some slicers will detect very small models and suggest that they might be in inches. So there are three answers to your question: 1)  Treat OpenSCAD units as millimeters, and wrap a "scale(25.4)" around your model so that you can design the bulk of it in inches. 2)  Treat OpenSCAD units as inches, and have your slicer scale. 3)  Treat OpenSCAD units as millimeters, and design in millimeters. I try to design in millimeters, but many years of habits make that hard.  When I design in inches, I define a variable "inch" with a value of 25.4, so that I can say, e.g., "12*inch".  Why do I do that, instead of using scale()?  Because the measurements on the printer - layer height, extrusion width - are in millimeters, and so when I need to do stuff where the printer's resolution matters I want to be able to drop into metric.  A lot of my work is on scale models, so I often set "inch" to 1 for my 1:25.4 scale, and then I can use "3*inch" to mean three scale inches, and use bare numbers where I need to get special effects down around the printer resolution.
BL
Bryan Lee
Mon, Aug 30, 2021 11:28 PM

@Charles Meyer, I'm basically echoing what Jordan said:

The top of my OpenScad files tend to look like this:

SCALE=1;	// Global rescale value
inchtoMM=25.4;	// 1 inch equals 25.4mm

main_body_diameter= 4 * inchtoMM * SCALE;
main_body_height= 66 * inchtoMM * SCALE;
bulge_vertical_offset = 100 * SCALE;		// bulge is 100mm up
bulge_diameter_offset = main_body_diameter + 5;	// bulge is body + 5mm
M5_screw_diameter = 5 * SCALE;			// M5 screw is 5 mm diameter

This lets me:
1) specify all measurements at the top of my file
2) Work in either mm or inches, but I also work in meters sometimes
3) Alter the export SCALE to whatever scale I need, depending on
if the target output is for 3d printing, CAD, lasercutting, or import into
a videogame.

Thus Jordan Brown hast written on Mon, Aug 30, 2021 at 03:37:40PM +0000, and, according to prophecy, it shall come to pass that:

On 8/29/2021 12:44 PM, charles meyer wrote:

 Is there a way to change the width settings  in OpenSCAD from millimeters
 to inches?

OpenSCAD is unitless.  There's nothing that says whether the units are
millimeters, inches, or furlongs.  Similarly, STLs are unitless.

Indeed, most people treat OpenSCAD units and STL units as millimeters, but
that's a matter of how consuming programs use them.

Apparently some people generate STLs where the units are intended to be inches,
because some slicers will detect very small models and suggest that they might
be in inches.

So there are three answers to your question:

1)  Treat OpenSCAD units as millimeters, and wrap a "scale(25.4)" around your
model so that you can design the bulk of it in inches.
2)  Treat OpenSCAD units as inches, and have your slicer scale.
3)  Treat OpenSCAD units as millimeters, and design in millimeters.

I try to design in millimeters, but many years of habits make that hard.  When
I design in inches, I define a variable "inch" with a value of 25.4, so that I
can say, e.g., "12inch".  Why do I do that, instead of using scale()?  Because
the measurements on the printer - layer height, extrusion width - are in
millimeters, and so when I need to do stuff where the printer's resolution
matters I want to be able to drop into metric.  A lot of my work is on scale
models, so I often set "inch" to 1 for my 1:25.4 scale, and then I can use
"3
inch" to mean three scale inches, and use bare numbers where I need to get
special effects down around the printer resolution.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

@Charles Meyer, I'm basically echoing what Jordan said: The top of my OpenScad files tend to look like this: SCALE=1; // Global rescale value inchtoMM=25.4; // 1 inch equals 25.4mm main_body_diameter= 4 * inchtoMM * SCALE; main_body_height= 66 * inchtoMM * SCALE; bulge_vertical_offset = 100 * SCALE; // bulge is 100mm up bulge_diameter_offset = main_body_diameter + 5; // bulge is body + 5mm M5_screw_diameter = 5 * SCALE; // M5 screw is 5 mm diameter This lets me: 1) specify all measurements at the top of my file 2) Work in either mm or inches, but I also work in meters sometimes 3) Alter the export SCALE to whatever scale I need, depending on if the target output is for 3d printing, CAD, lasercutting, or import into a videogame. Thus Jordan Brown hast written on Mon, Aug 30, 2021 at 03:37:40PM +0000, and, according to prophecy, it shall come to pass that: > On 8/29/2021 12:44 PM, charles meyer wrote: > > Is there a way to change the width settings  in OpenSCAD from millimeters > to inches? > > > OpenSCAD is unitless.  There's nothing that says whether the units are > millimeters, inches, or furlongs.  Similarly, STLs are unitless. > > Indeed, most people treat OpenSCAD units and STL units as millimeters, but > that's a matter of how consuming programs use them. > > Apparently some people generate STLs where the units are intended to be inches, > because some slicers will detect very small models and suggest that they might > be in inches. > > So there are three answers to your question: > > 1)  Treat OpenSCAD units as millimeters, and wrap a "scale(25.4)" around your > model so that you can design the bulk of it in inches. > 2)  Treat OpenSCAD units as inches, and have your slicer scale. > 3)  Treat OpenSCAD units as millimeters, and design in millimeters. > > I try to design in millimeters, but many years of habits make that hard.  When > I design in inches, I define a variable "inch" with a value of 25.4, so that I > can say, e.g., "12*inch".  Why do I do that, instead of using scale()?  Because > the measurements on the printer - layer height, extrusion width - are in > millimeters, and so when I need to do stuff where the printer's resolution > matters I want to be able to drop into metric.  A lot of my work is on scale > models, so I often set "inch" to 1 for my 1:25.4 scale, and then I can use > "3*inch" to mean three scale inches, and use bare numbers where I need to get > special effects down around the printer resolution. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org