discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: [OpenSCAD] Split .stl using difference??

CJ
Chris Johnson
Sun, Mar 7, 2021 4:37 PM

Awesome, thanks! I'll give that a try.  I like the way you've used modules
for the parts and processes.  It makes reading what its doing easier.  I
used 2 single docks and then joined them so that I could make the centre
wall thicker so that when I split the model asymmetrically there were some
overlapping faces for glueing it together. And I used the cylinders to
create jigsaw like sockets and parts to help lock the pieces together.
Probably overkill but it was good practice learning a new product

In the end the missing faces turned out to be due to the fact that I'd not
pressed F6 to render.

Time to print... :-)

Chris Johnson

On Sun, 7 Mar 2021 at 08:01, Rogier Wolff R.E.Wolff@bitwizard.nl wrote:

On Sat, Mar 06, 2021 at 04:48:52PM +0000, Chris Johnson via Discuss wrote:

I want to print a .stl model (from Thingiverse) that is too long for my

3d

printer bed. If I split it in 2 parts each half will fit on the print bed
I read in a forum post that you should be able to split a model by
creating a shape that covers half of the model to split and using
difference or intersection commands to create 2 halves.

However when I do the difference or intersection operation the remaining
part of the .stl appears to have faces missing.

I'm a noob to opscad having moved from Fusion 360 so any help

appreciated.

Here's my scad file

Here is mine:


module obj ()
{
import ("2_Dual_Dock.stl", convexity = 10);
}

module splitter ()
{
translate ([-80,0,-5]) cube ([130,120,140]);
}

module p1 ()
{
difference () {
obj ();
splitter ();
}
}

module p2 ()
{
intersection () {
obj ();
splitter ();
}
}

translate ([0,  5,0]) p2 ();
translate ([0, -5,0]) p1 ();


     Roger.

intersection(){
union(){import ("/Users/chrisjohnson/Downloads/1_Single_Dock.stl");

translate([41.5,0,0]){
import ("/Users/chrisjohnson/Downloads/1_Single_Dock.stl");
}
}

union(){
translate([40,68,60]){
color("green",0.5){
cube ([44,120,140], center = true);
}
}
translate([-39,68,60]){
color("green",0.5){
cube ([40,120,140], center = true);
}
}

translate([.5,52.5,61]){
color("blue",0.5){
cube ([40.5,120,140], center = true);
}
}
translate([81,52.5,61]){
color("blue",0.5){
cube ([40.5,120,140], center = true);
}
}

translate([-2,-12,-20]){
color("red",0.5){
cylinder(30,10,10);
}
}

translate([40,3,-20]){
color("red",0.5){
cylinder(30,10,10);
}
}
}
}

and here's the link to the .stl file Download
https://cdn.thingiverse.com/assets/c3/6d/8b/8b/b5/2_Dual_Dock.stl

Chris Johnson

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110
**
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

Awesome, thanks! I'll give that a try. I like the way you've used modules for the parts and processes. It makes reading what its doing easier. I used 2 single docks and then joined them so that I could make the centre wall thicker so that when I split the model asymmetrically there were some overlapping faces for glueing it together. And I used the cylinders to create jigsaw like sockets and parts to help lock the pieces together. Probably overkill but it was good practice learning a new product In the end the missing faces turned out to be due to the fact that I'd not pressed F6 to render. Time to print... :-) Chris Johnson On Sun, 7 Mar 2021 at 08:01, Rogier Wolff <R.E.Wolff@bitwizard.nl> wrote: > On Sat, Mar 06, 2021 at 04:48:52PM +0000, Chris Johnson via Discuss wrote: > > I want to print a .stl model (from Thingiverse) that is too long for my > 3d > > printer bed. If I split it in 2 parts each half will fit on the print bed > > I read in a forum post that you should be able to split a model by > > creating a shape that covers half of the model to split and using > > difference or intersection commands to create 2 halves. > > > > However when I do the difference or intersection operation the remaining > > part of the .stl appears to have faces missing. > > > > I'm a noob to opscad having moved from Fusion 360 so any help > appreciated. > > > > Here's my scad file > > Here is mine: > > ---------------------- > > module obj () > { > import ("2_Dual_Dock.stl", convexity = 10); > } > > module splitter () > { > translate ([-80,0,-5]) cube ([130,120,140]); > } > > module p1 () > { > difference () { > obj (); > splitter (); > } > } > > module p2 () > { > intersection () { > obj (); > splitter (); > } > } > > > translate ([0, 5,0]) p2 (); > translate ([0, -5,0]) p1 (); > > -------------------------------------- > > Roger. > > > > > > intersection(){ > > union(){import ("/Users/chrisjohnson/Downloads/1_Single_Dock.stl"); > > > > translate([41.5,0,0]){ > > import ("/Users/chrisjohnson/Downloads/1_Single_Dock.stl"); > > } > > } > > > > > > union(){ > > translate([40,68,60]){ > > color("green",0.5){ > > cube ([44,120,140], center = true); > > } > > } > > translate([-39,68,60]){ > > color("green",0.5){ > > cube ([40,120,140], center = true); > > } > > } > > > > > > translate([.5,52.5,61]){ > > color("blue",0.5){ > > cube ([40.5,120,140], center = true); > > } > > } > > translate([81,52.5,61]){ > > color("blue",0.5){ > > cube ([40.5,120,140], center = true); > > } > > } > > > > > > translate([-2,-12,-20]){ > > color("red",0.5){ > > cylinder(30,10,10); > > } > > } > > > > translate([40,3,-20]){ > > color("red",0.5){ > > cylinder(30,10,10); > > } > > } > > } > > } > > > > and here's the link to the .stl file Download > > <https://cdn.thingiverse.com/assets/c3/6d/8b/8b/b5/2_Dual_Dock.stl> > > > > Chris Johnson > > > _______________________________________________ > > OpenSCAD mailing list > > Discuss@lists.openscad.org > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > > -- > ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 > ** > ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** > f equals m times a. When your f is steady, and your m is going down > your a is going up. -- Chris Hadfield about flying up the space shuttle. >
BC
Bob Carter
Sun, Mar 7, 2021 5:11 PM

No the missing faces are due to the completely different tools that F5 and F6 use to render the view - I fell over this a few weeks back. For F5 Openscad uses OpenCSG and that needs to know how visually complex an object is and that is defined by the convexity of the object. But if you do not specify it the Convexity parameter defaults to 2 and in your case you had a complex object and there were more than 2 faces transitions that each ray crossed but OpenCSG simply did not render the faces at the back as it did not know they were there.

The convexity parameter specifies the maximum number of front sides (or back sides) a ray intersecting the object might penetrate. This parameter is only needed for correctly displaying the object in OpenCSG (F5) preview mode and has no effect on the polyhedron rendering (F6).

Cheers
Bob

On 7 Mar 2021, at 16:37, Chris Johnson via Discuss discuss@lists.openscad.org wrote:

Awesome, thanks! I'll give that a try.  I like the way you've used modules for the parts and processes.  It makes reading what its doing easier.  I used 2 single docks and then joined them so that I could make the centre wall thicker so that when I split the model asymmetrically there were some overlapping faces for glueing it together. And I used the cylinders to create jigsaw like sockets and parts to help lock the pieces together.  Probably overkill but it was good practice learning a new product

In the end the missing faces turned out to be due to the fact that I'd not pressed F6 to render.

Time to print... :-)

Chris Johnson

On Sun, 7 Mar 2021 at 08:01, Rogier Wolff <R.E.Wolff@bitwizard.nl mailto:R.E.Wolff@bitwizard.nl> wrote:
On Sat, Mar 06, 2021 at 04:48:52PM +0000, Chris Johnson via Discuss wrote:

I want to print a .stl model (from Thingiverse) that is too long for my 3d
printer bed. If I split it in 2 parts each half will fit on the print bed
I read in a forum post that you should be able to split a model by
creating a shape that covers half of the model to split and using
difference or intersection commands to create 2 halves.

However when I do the difference or intersection operation the remaining
part of the .stl appears to have faces missing.

I'm a noob to opscad having moved from Fusion 360 so any help appreciated.

Here's my scad file

Here is mine:


module obj ()
{
import ("2_Dual_Dock.stl", convexity = 10);
}

module splitter ()
{
translate ([-80,0,-5]) cube ([130,120,140]);
}

module p1 ()
{
difference () {
obj ();
splitter ();
}
}

module p2 ()
{
intersection () {
obj ();
splitter ();
}
}

translate ([0,  5,0]) p2 ();
translate ([0, -5,0]) p1 ();


     Roger. 

intersection(){
union(){import ("/Users/chrisjohnson/Downloads/1_Single_Dock.stl");

translate([41.5,0,0]){
import ("/Users/chrisjohnson/Downloads/1_Single_Dock.stl");
}
}

union(){
translate([40,68,60]){
color("green",0.5){
cube ([44,120,140], center = true);
}
}
translate([-39,68,60]){
color("green",0.5){
cube ([40,120,140], center = true);
}
}

translate([.5,52.5,61]){
color("blue",0.5){
cube ([40.5,120,140], center = true);
}
}
translate([81,52.5,61]){
color("blue",0.5){
cube ([40.5,120,140], center = true);
}
}

translate([-2,-12,-20]){
color("red",0.5){
cylinder(30,10,10);
}
}

translate([40,3,-20]){
color("red",0.5){
cylinder(30,10,10);
}
}
}
}

and here's the link to the .stl file Download
<https://cdn.thingiverse.com/assets/c3/6d/8b/8b/b5/2_Dual_Dock.stl https://cdn.thingiverse.com/assets/c3/6d/8b/8b/b5/2_Dual_Dock.stl>

Chris Johnson

--
** R.E.Wolff@BitWizard.nl mailto:R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ https://www.bitwizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.


OpenSCAD mailing list
Discuss@lists.openscad.org mailto:Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

No the missing faces are due to the completely different tools that F5 and F6 use to render the view - I fell over this a few weeks back. For F5 Openscad uses OpenCSG and that needs to know how visually complex an object is and that is defined by the convexity of the object. But if you do not specify it the Convexity parameter defaults to 2 and in your case you had a complex object and there were more than 2 faces transitions that each ray crossed but OpenCSG simply did not render the faces at the back as it did not know they were there. > The convexity parameter specifies the maximum number of front sides (or back sides) a ray intersecting the object might penetrate. This parameter is only needed for correctly displaying the object in OpenCSG (F5) preview mode and has no effect on the polyhedron rendering (F6). Cheers Bob > On 7 Mar 2021, at 16:37, Chris Johnson via Discuss <discuss@lists.openscad.org> wrote: > > Awesome, thanks! I'll give that a try. I like the way you've used modules for the parts and processes. It makes reading what its doing easier. I used 2 single docks and then joined them so that I could make the centre wall thicker so that when I split the model asymmetrically there were some overlapping faces for glueing it together. And I used the cylinders to create jigsaw like sockets and parts to help lock the pieces together. Probably overkill but it was good practice learning a new product > > In the end the missing faces turned out to be due to the fact that I'd not pressed F6 to render. > > Time to print... :-) > > Chris Johnson > > > On Sun, 7 Mar 2021 at 08:01, Rogier Wolff <R.E.Wolff@bitwizard.nl <mailto:R.E.Wolff@bitwizard.nl>> wrote: > On Sat, Mar 06, 2021 at 04:48:52PM +0000, Chris Johnson via Discuss wrote: > > I want to print a .stl model (from Thingiverse) that is too long for my 3d > > printer bed. If I split it in 2 parts each half will fit on the print bed > > I read in a forum post that you should be able to split a model by > > creating a shape that covers half of the model to split and using > > difference or intersection commands to create 2 halves. > > > > However when I do the difference or intersection operation the remaining > > part of the .stl appears to have faces missing. > > > > I'm a noob to opscad having moved from Fusion 360 so any help appreciated. > > > > Here's my scad file > > Here is mine: > > ---------------------- > > module obj () > { > import ("2_Dual_Dock.stl", convexity = 10); > } > > module splitter () > { > translate ([-80,0,-5]) cube ([130,120,140]); > } > > module p1 () > { > difference () { > obj (); > splitter (); > } > } > > module p2 () > { > intersection () { > obj (); > splitter (); > } > } > > > translate ([0, 5,0]) p2 (); > translate ([0, -5,0]) p1 (); > > -------------------------------------- > > Roger. > > > > > > intersection(){ > > union(){import ("/Users/chrisjohnson/Downloads/1_Single_Dock.stl"); > > > > translate([41.5,0,0]){ > > import ("/Users/chrisjohnson/Downloads/1_Single_Dock.stl"); > > } > > } > > > > > > union(){ > > translate([40,68,60]){ > > color("green",0.5){ > > cube ([44,120,140], center = true); > > } > > } > > translate([-39,68,60]){ > > color("green",0.5){ > > cube ([40,120,140], center = true); > > } > > } > > > > > > translate([.5,52.5,61]){ > > color("blue",0.5){ > > cube ([40.5,120,140], center = true); > > } > > } > > translate([81,52.5,61]){ > > color("blue",0.5){ > > cube ([40.5,120,140], center = true); > > } > > } > > > > > > translate([-2,-12,-20]){ > > color("red",0.5){ > > cylinder(30,10,10); > > } > > } > > > > translate([40,3,-20]){ > > color("red",0.5){ > > cylinder(30,10,10); > > } > > } > > } > > } > > > > and here's the link to the .stl file Download > > <https://cdn.thingiverse.com/assets/c3/6d/8b/8b/b5/2_Dual_Dock.stl <https://cdn.thingiverse.com/assets/c3/6d/8b/8b/b5/2_Dual_Dock.stl>> > > > > Chris Johnson > > > _______________________________________________ > > OpenSCAD mailing list > > Discuss@lists.openscad.org <mailto:Discuss@lists.openscad.org> > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org <http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org> > > > -- > ** R.E.Wolff@BitWizard.nl <mailto:R.E.Wolff@BitWizard.nl> ** https://www.BitWizard.nl/ <https://www.bitwizard.nl/> ** +31-15-2049110 ** > ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** > f equals m times a. When your f is steady, and your m is going down > your a is going up. -- Chris Hadfield about flying up the space shuttle. > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org <mailto:Discuss@lists.openscad.org> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org <http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org>