discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: How to extract DXF files from this OpenSCAD code

KT
Kevin Toppenberg
Thu, Apr 21, 2022 6:57 PM

I think DXF files are just 2D, though I may be mistaken.

Kevin

On Thu, Apr 21, 2022 at 9:59 AM beasponge--- via Discuss <
discuss@lists.openscad.org> wrote:

---------- Forwarded message ----------
From: beasponge@protonmail.com
To: discuss@lists.openscad.org
Cc:
Bcc:
Date: Thu, 21 Apr 2022 13:59:09 +0000
Subject: [OpenSCAD] How to extract DXF files from this OpenSCAD code

Hello Everyone.

side note: I did try and ask this in the Libera Chat but for some reason
it booted me out and I couldn’t get back in. Apologies if you read this
again.

I am very new to OpenSCAD. As In like 1 day old. I have been watching
hours of tutorials and read quite a lot - I think my head is about to
explode with all the information I am trying to absorb. I have very little
coding/ programming experience - I have played around with Python a little
and that is it.

Anyhow, I made a parametric coffee table and just WOW! I can’t believe how
easy it was as compared to my attempts in other CAD programs but I am a
little stuck.

I have modeled it (or assume I have - remember I am still a noob) so that
each cube is a separate part of the coffee table and now I would like
export each piece as a dxf with its dimensions so that it can be used to
create a cut list or be used in a CAM program for CNC work - can anyone
advise me on how to go about this?

Thanks in advance

Here is the code:

Length = 1200;

Width = 600;

Thickness = 16;

TrimThickness = 32;

Height = 400;

LegWidth = 100;

//table top

cube([Length,Width,Thickness]);

//Leftside trim

translate([0,0,-TrimThickness])

cube([Length, Thickness,TrimThickness]);

//FrontSideTrim

translate([Length-Thickness,Thickness,-TrimThickness])

cube([Thickness, Width-Thickness*2, TrimThickness]);

//RightSideTrim

translate([0,Width-Thickness,-TrimThickness])

cube([Length, Thickness,TrimThickness]);

//BackSideTrim

translate([0,Thickness,-TrimThickness])

cube([Thickness, Width-Thickness*2, TrimThickness]);

//LeftBacklegassembly

translate([Thickness,Thickness,-Height])

cube([LegWidth, Thickness, Height]);

translate([Thickness,Thickness,-Height])

//This is the back piece which is a little shorterwidth wise to accomodate the thickness of the other leg

cube([Thickness,LegWidth-Thickness,Height]);

//RightBackLegAssembly

translate([Thickness,Width-Thickness*2,-Height])

cube([LegWidth, Thickness, Height]);

translate([Thickness,Width-LegWidth-Thickness,-Height])

//This is the back piece which is a little shorterwidth wise to accomodate the thickness of the other leg

cube([Thickness,LegWidth-Thickness,Height]);

//LeftFrontlegassembly

translate([Length-LegWidth -Thickness,Thickness,-Height])

cube([LegWidth, Thickness, Height]);

translate([Length-Thickness*2,Thickness,-Height])

//This is the back piece which is a little shorterwidth wise to accomodate the thickness of the other leg

cube([Thickness,LegWidth-Thickness,Height]);

//RightFrontLegAssembly

translate([Length-LegWidth-Thickness,Width-Thickness*2,-Height])

cube([LegWidth, Thickness, Height]);

translate([Length-Thickness*2,Width-LegWidth-Thickness,-Height])

//This is the back piece which is a little shorterwidth wise to accomodate the thickness of the other leg

cube([Thickness,LegWidth-Thickness,Height]);

//BottomShelf

translate([Thickness2,Thickness2,-Height+100])

cube([Length-Thickness4,Width-Thickness4,Thickness]);

---------- Forwarded message ----------
From: beasponge--- via Discuss discuss@lists.openscad.org
To: discuss@lists.openscad.org
Cc: beasponge@protonmail.com
Bcc:
Date: Thu, 21 Apr 2022 13:59:09 +0000
Subject: [OpenSCAD] How to extract DXF files from this OpenSCAD code


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

I think DXF files are just 2D, though I may be mistaken. Kevin On Thu, Apr 21, 2022 at 9:59 AM beasponge--- via Discuss < discuss@lists.openscad.org> wrote: > > > > ---------- Forwarded message ---------- > From: beasponge@protonmail.com > To: discuss@lists.openscad.org > Cc: > Bcc: > Date: Thu, 21 Apr 2022 13:59:09 +0000 > Subject: [OpenSCAD] How to extract DXF files from this OpenSCAD code > > Hello Everyone. > > > *side note: I did try and ask this in the Libera Chat but for some reason > it booted me out and I couldn’t get back in. Apologies if you read this > again.* > > > I am very new to OpenSCAD. As In like 1 day old. I have been watching > hours of tutorials and read quite a lot - I think my head is about to > explode with all the information I am trying to absorb. I have very little > coding/ programming experience - I have played around with Python a little > and that is it. > > Anyhow, I made a parametric coffee table and just WOW! I can’t believe how > easy it was as compared to my attempts in other CAD programs but I am a > little stuck. > > I have modeled it (or assume I have - remember I am still a noob) so that > each cube is a separate part of the coffee table and now I would like > export each piece as a dxf with its dimensions so that it can be used to > create a cut list or be used in a CAM program for CNC work - can anyone > advise me on how to go about this? > > > Thanks in advance > > > Here is the code: > > > Length = 1200; > > Width = 600; > > Thickness = 16; > > TrimThickness = 32; > > Height = 400; > > LegWidth = 100; > > //table top > > cube([Length,Width,Thickness]); > > //Leftside trim > > translate([0,0,-TrimThickness]) > > cube([Length, Thickness,TrimThickness]); > > //FrontSideTrim > > translate([Length-Thickness,Thickness,-TrimThickness]) > > cube([Thickness, Width-Thickness*2, TrimThickness]); > > //RightSideTrim > > translate([0,Width-Thickness,-TrimThickness]) > > cube([Length, Thickness,TrimThickness]); > > //BackSideTrim > > translate([0,Thickness,-TrimThickness]) > > cube([Thickness, Width-Thickness*2, TrimThickness]); > > //LeftBacklegassembly > > translate([Thickness,Thickness,-Height]) > > cube([LegWidth, Thickness, Height]); > > translate([Thickness,Thickness,-Height]) > > //This is the back piece which is a little shorterwidth wise to accomodate the thickness of the other leg > > cube([Thickness,LegWidth-Thickness,Height]); > > //RightBackLegAssembly > > translate([Thickness,Width-Thickness*2,-Height]) > > cube([LegWidth, Thickness, Height]); > > translate([Thickness,Width-LegWidth-Thickness,-Height]) > > //This is the back piece which is a little shorterwidth wise to accomodate the thickness of the other leg > > cube([Thickness,LegWidth-Thickness,Height]); > > //LeftFrontlegassembly > > translate([Length-LegWidth -Thickness,Thickness,-Height]) > > cube([LegWidth, Thickness, Height]); > > translate([Length-Thickness*2,Thickness,-Height]) > > //This is the back piece which is a little shorterwidth wise to accomodate the thickness of the other leg > > cube([Thickness,LegWidth-Thickness,Height]); > > //RightFrontLegAssembly > > translate([Length-LegWidth-Thickness,Width-Thickness*2,-Height]) > > cube([LegWidth, Thickness, Height]); > > translate([Length-Thickness*2,Width-LegWidth-Thickness,-Height]) > > //This is the back piece which is a little shorterwidth wise to accomodate the thickness of the other leg > > cube([Thickness,LegWidth-Thickness,Height]); > > //BottomShelf > > translate([Thickness*2,Thickness*2,-Height+100]) > > cube([Length-Thickness*4,Width-Thickness*4,Thickness]); > > > > > ---------- Forwarded message ---------- > From: beasponge--- via Discuss <discuss@lists.openscad.org> > To: discuss@lists.openscad.org > Cc: beasponge@protonmail.com > Bcc: > Date: Thu, 21 Apr 2022 13:59:09 +0000 > Subject: [OpenSCAD] How to extract DXF files from this OpenSCAD code > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >