discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: YAPDOR (yet another part disappears on render) question

D
dpa
Wed, Nov 10, 2021 1:11 AM

In 'obj_points1' are a lot of almost equal points.
All multiples of ±0.25, they are just close and complicated written like
0.24999999999144
My guess is that you use in 'two()' (almost) the same points again and
again which causes a 3D skinning chaos..

Am Mi., 10. Nov. 2021 um 00:26 Uhr schrieb Gryffyn via Discuss <
discuss@lists.openscad.org>:

---------- Forwarded message ----------
From: Gryffyn blkgryffyn@yahoo.com
To: "discuss@lists.openscad.org" discuss@lists.openscad.org
Cc:
Bcc:
Date: Tue, 9 Nov 2021 23:26:19 +0000 (UTC)
Subject: [OpenSCAD] YAPDOR (yet another part disappears on render) question
I see lots of posts online with similar issues, but the solutions I see
are about bugged older versions or one mention of an implicit "union" when
objects are rendered one after another.  To get around that, I put the
objects in separate modules and it still does it.  This is part of a
larger crude Christmas tree type design.  I set up a thing to convert the
raw Earth2.io "holobuilding" data to OpenSCAD to generate a 3D model
outside of Earth2.io.  Someone designed a Christmas tree type thing and it
was skipping some of the "branches".  I cut down the code so it's just the
center trunk/pole and one branch that disappears when both are rendered.

Both show up in preview, but not render.

I feel like this question is asked a ton, but again.. didn't see any
answers that seemed to help my situation.  I know it's going to be
"something stupid" (tm) so forgive my OpenSCAD ignorance.

Thanks in advance.

-Trevor

Version: OpenSCAD version 2021.01

Code:

one();
two();

module one() {
// stick
echo("Starting ONE");
translate([0, 0, 0])
linear_extrude(height=16)
polygon(points= [[0, 0],[-0.250000011875, -0.25000000096],[0,
-0.50000000101],[0.24999999732, -0.25000000096],[0, 0]]);
echo("Finishing ONE");
}

module two() {
echo("objpoints TWO start");
// small one
obj_points1 =[[-1.750000003085, -1.500000001215],[-0.250000011875,
-1.000000000205],[-0.500000009195, -1.250000001165],[-0.250000011875,
-1.000000000205],[0, -1.000000000205],[0, -1.750000000355],[0.24999999732,
-1.250000001165],[0.24999999732, -1.750000000355],[0.24999999732,
-1.000000000205],[0.24999999732, -1.250000001165],[0.24999999732,
-1.000000000205],[0.999999996565, -1.000000000205],[1.24999999389,
-1.250000001165],[0.999999996565, -1.000000000205],[1.74999999581,
-1.250000001165],[1.49999999121, -1.250000001165],[0.999999996565,
-1.000000000205],[1.24999999389, -1.000000000205],[0.999999996565,
-0.750000000155],[0.749999999245, -0.50000000101],[0.999999996565,
-0.50000000101],[1.74999999581, -0.50000000101],[1.24999999389,
-0.25000000096],[1.74999999581, 0],[0.999999996565,
-0.25000000096],[1.49999999121, 0],[0.749999999245,
-0.25000000096],[0.749999999245, -0.25000000096],[0.999999996565,
0.24999999914],[0.999999996565, 0.49999999919],[1.24999999389,
0.749999999245],[0.999999996565, 0.49999999919],[1.24999999389,
0.999999999295],[0.24999999732, 0.24999999914],[0.499999994645,
1.249999999345],[0.24999999732, 0.999999999295],[0.24999999732,
1.249999999345],[0.24999999732, 0.49999999919],[0.24999999732,
0.49999999919],[0, 0.749999999245],[0, 0.24999999914],[0,
0.24999999914],[-0.75000000652, 1.249999999345],[-0.250000011875,
0.49999999919],[-0.500000009195, 0.49999999919],[-0.75000000652,
0.999999999295],[-0.75000000652, 0.749999999245],[-0.75000000652,
0.749999999245],[-0.75000000652, 0.49999999919],[-0.500000009195,
0.49999999919],[-0.75000000652, 0.49999999919],[-0.500000009195,
0.24999999914],[-0.250000011875, 0],[-0.500000009195, 0],[-1.500000005765,
0.24999999914],[-0.75000000652, 0],[-0.75000000652, 0],[-1.00000000384,
0],[-0.75000000652, -0.25000000096],[-1.500000005765,
-0.50000000101],[-0.500000009195, -0.50000000101],[-1.500000005765,
-1.000000000205],[-0.75000000652, -0.750000000155],[-1.750000003085,
-1.500000001215],[-0.250000011875, -0.25000000096],[0, 0],[0.24999999732,
-0.25000000096],[0, -0.50000000101],[-0.250000011875, -0.25000000096]];
echo("objpoints TWO end");
echo("objpaths TWO start");
obj_paths1
=[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63]];
echo("objpaths TWO end");
echo("Starting TWO");
// FAILS
translate([0, 0, 2])
linear_extrude(height=0.2)
polygon(obj_points1, obj_paths1);
echo("Finishing TWO");
}

Log results on Render:

Parsing design (AST generation)...

Saved backup file:
C:/Users/blkgr/Documents/OpenSCAD/backups/unsaved-backup-hrNNKeVd.scad

Compiling design (CSG Tree generation)...

ECHO: "Starting ONE"

ECHO: "Finishing ONE"

ECHO: "objpoints TWO start"

ECHO: "objpoints TWO end"

ECHO: "objpaths TWO start"

ECHO: "objpaths TWO end"

ECHO: "Starting TWO"

ECHO: "Finishing TWO"

Rendering Polygon Mesh using CGAL...

Geometries in cache: 59

Geometry cache size in bytes: 602280

CGAL Polyhedrons in cache: 11

CGAL cache size in bytes: 3095648

Total rendering time: 0:00:00.047

Top level object is a 3D object:

Simple: yes

Vertices: 8

Halfedges: 24

Edges: 12

Halffacets: 12

Facets: 6

Volumes: 2

Rendering finished.

---------- Forwarded message ----------
From: Gryffyn via Discuss discuss@lists.openscad.org
To: "discuss@lists.openscad.org" discuss@lists.openscad.org
Cc: Gryffyn blkgryffyn@yahoo.com
Bcc:
Date: Tue, 9 Nov 2021 23:26:19 +0000 (UTC)
Subject: [OpenSCAD] YAPDOR (yet another part disappears on render) question


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

In 'obj_points1' are a lot of almost equal points. All multiples of ±0.25, they are just close and complicated written like 0.24999999999144 My guess is that you use in 'two()' (almost) the same points again and again which causes a 3D skinning chaos.. Am Mi., 10. Nov. 2021 um 00:26 Uhr schrieb Gryffyn via Discuss < discuss@lists.openscad.org>: > > > > ---------- Forwarded message ---------- > From: Gryffyn <blkgryffyn@yahoo.com> > To: "discuss@lists.openscad.org" <discuss@lists.openscad.org> > Cc: > Bcc: > Date: Tue, 9 Nov 2021 23:26:19 +0000 (UTC) > Subject: [OpenSCAD] YAPDOR (yet another part disappears on render) question > I see lots of posts online with similar issues, but the solutions I see > are about bugged older versions or one mention of an implicit "union" when > objects are rendered one after another. To get around that, I put the > objects in separate modules and it still does it. This is part of a > larger crude Christmas tree type design. I set up a thing to convert the > raw Earth2.io "holobuilding" data to OpenSCAD to generate a 3D model > outside of Earth2.io. Someone designed a Christmas tree type thing and it > was skipping some of the "branches". I cut down the code so it's just the > center trunk/pole and one branch that disappears when both are rendered. > > Both show up in preview, but not render. > > I feel like this question is asked a ton, but again.. didn't see any > answers that seemed to help my situation. I know it's going to be > "something stupid" (tm) so forgive my OpenSCAD ignorance. > > Thanks in advance. > > -Trevor > > > Version: OpenSCAD version 2021.01 > > Code: > > one(); > two(); > > module one() { > // stick > echo("Starting ONE"); > translate([0, 0, 0]) > linear_extrude(height=16) > polygon(points= [[0, 0],[-0.250000011875, -0.25000000096],[0, > -0.50000000101],[0.24999999732, -0.25000000096],[0, 0]]); > echo("Finishing ONE"); > } > > module two() { > echo("objpoints TWO start"); > // small one > obj_points1 =[[-1.750000003085, -1.500000001215],[-0.250000011875, > -1.000000000205],[-0.500000009195, -1.250000001165],[-0.250000011875, > -1.000000000205],[0, -1.000000000205],[0, -1.750000000355],[0.24999999732, > -1.250000001165],[0.24999999732, -1.750000000355],[0.24999999732, > -1.000000000205],[0.24999999732, -1.250000001165],[0.24999999732, > -1.000000000205],[0.999999996565, -1.000000000205],[1.24999999389, > -1.250000001165],[0.999999996565, -1.000000000205],[1.74999999581, > -1.250000001165],[1.49999999121, -1.250000001165],[0.999999996565, > -1.000000000205],[1.24999999389, -1.000000000205],[0.999999996565, > -0.750000000155],[0.749999999245, -0.50000000101],[0.999999996565, > -0.50000000101],[1.74999999581, -0.50000000101],[1.24999999389, > -0.25000000096],[1.74999999581, 0],[0.999999996565, > -0.25000000096],[1.49999999121, 0],[0.749999999245, > -0.25000000096],[0.749999999245, -0.25000000096],[0.999999996565, > 0.24999999914],[0.999999996565, 0.49999999919],[1.24999999389, > 0.749999999245],[0.999999996565, 0.49999999919],[1.24999999389, > 0.999999999295],[0.24999999732, 0.24999999914],[0.499999994645, > 1.249999999345],[0.24999999732, 0.999999999295],[0.24999999732, > 1.249999999345],[0.24999999732, 0.49999999919],[0.24999999732, > 0.49999999919],[0, 0.749999999245],[0, 0.24999999914],[0, > 0.24999999914],[-0.75000000652, 1.249999999345],[-0.250000011875, > 0.49999999919],[-0.500000009195, 0.49999999919],[-0.75000000652, > 0.999999999295],[-0.75000000652, 0.749999999245],[-0.75000000652, > 0.749999999245],[-0.75000000652, 0.49999999919],[-0.500000009195, > 0.49999999919],[-0.75000000652, 0.49999999919],[-0.500000009195, > 0.24999999914],[-0.250000011875, 0],[-0.500000009195, 0],[-1.500000005765, > 0.24999999914],[-0.75000000652, 0],[-0.75000000652, 0],[-1.00000000384, > 0],[-0.75000000652, -0.25000000096],[-1.500000005765, > -0.50000000101],[-0.500000009195, -0.50000000101],[-1.500000005765, > -1.000000000205],[-0.75000000652, -0.750000000155],[-1.750000003085, > -1.500000001215],[-0.250000011875, -0.25000000096],[0, 0],[0.24999999732, > -0.25000000096],[0, -0.50000000101],[-0.250000011875, -0.25000000096]]; > echo("objpoints TWO end"); > echo("objpaths TWO start"); > obj_paths1 > =[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63]]; > echo("objpaths TWO end"); > echo("Starting TWO"); > // FAILS > translate([0, 0, 2]) > linear_extrude(height=0.2) > polygon(obj_points1, obj_paths1); > echo("Finishing TWO"); > } > > > > Log results on Render: > > Parsing design (AST generation)... > > Saved backup file: > C:/Users/blkgr/Documents/OpenSCAD/backups/unsaved-backup-hrNNKeVd.scad > > Compiling design (CSG Tree generation)... > > ECHO: "Starting ONE" > > ECHO: "Finishing ONE" > > ECHO: "objpoints TWO start" > > ECHO: "objpoints TWO end" > > ECHO: "objpaths TWO start" > > ECHO: "objpaths TWO end" > > ECHO: "Starting TWO" > > ECHO: "Finishing TWO" > > Rendering Polygon Mesh using CGAL... > > Geometries in cache: 59 > > Geometry cache size in bytes: 602280 > > CGAL Polyhedrons in cache: 11 > > CGAL cache size in bytes: 3095648 > > Total rendering time: 0:00:00.047 > > Top level object is a 3D object: > > Simple: yes > > Vertices: 8 > > Halfedges: 24 > > Edges: 12 > > Halffacets: 12 > > Facets: 6 > > Volumes: 2 > > Rendering finished. > > > > > ---------- Forwarded message ---------- > From: Gryffyn via Discuss <discuss@lists.openscad.org> > To: "discuss@lists.openscad.org" <discuss@lists.openscad.org> > Cc: Gryffyn <blkgryffyn@yahoo.com> > Bcc: > Date: Tue, 9 Nov 2021 23:26:19 +0000 (UTC) > Subject: [OpenSCAD] YAPDOR (yet another part disappears on render) question > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >