Skip to content

Instantly share code, notes, and snippets.

@arnholm
Last active April 27, 2019 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnholm/98b007bb960e328ef9a986a96b412607 to your computer and use it in GitHub Desktop.
Save arnholm/98b007bb960e328ef9a986a96b412607 to your computer and use it in GitHub Desktop.

This is the manyballs performance test using 5x5x5 balls

AngelCAD

13697 > "as_csg"  "manyballs_angelcad.as" -outsub="xcsg" -include="~/.angelcad/libraries" 
as_csg started.

Created XCSG file: xcsg/manyballs_angelcad.xcsg
as_csg v1.3-00 finished, time used: 0d 00h 00m 00.012s

13699 > "xcsg" --dxf --stl --svg  "xcsg/manyballs_angelcad.xcsg"
xcsg processing: xcsg/manyballs_angelcad.xcsg
processing solid: union3d
...completed CSG tree: 124 boolean operations to process.
...starting boolean operations
...boolean progress: 5.6% 
...boolean progress: 11.2% 
...boolean progress: 16.9% 
...boolean progress: 22.5% 
...boolean progress: 28.2% 
...boolean progress: 33.8% 
...boolean progress: 39.5% 
...boolean progress: 45.1% 
...boolean progress: 50.8% 
...boolean progress: 56.4% 
...boolean progress: 62% 
...boolean progress: 67.7% 
...boolean progress: 73.3% 
...boolean progress: 79% 
...boolean progress: 84.6% 
...boolean progress: 90.3% 
...boolean progress: 95.9% 
...completed boolean operations in 2.933 [sec] 
...result model contains 1 lump.
...lump 1: 21450 vertices, 36400 polygon faces.
...Polyhedron is water-tight (edge use-count check OK)
...Polyhedron has no degenerated faces (face area check OK)
...Polyhedron has 7200 non-triangular faces
...Triangulating lump ... 
...Triangulation completed with 43600 triangle faces in 1.302 [sec]
...Exporting results 
Created STL file     : xcsg/manyballs_angelcad.stl
xcsg finished using 0h 0m 4.264s

OpenSCAD

Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using CGAL...
Geometries in cache: 126
Geometry cache size in bytes: 5613552
CGAL Polyhedrons in cache: 1
CGAL cache size in bytes: 85007608
Total rendering time: 0 hours, 3 minutes, 54 seconds
   Top level object is a 3D object:
   Simple:        yes
   Vertices:    37625
   Halfedges:  197450
   Edges:       98725
   Halffacets: 121500
   Facets:      60750
   Volumes:         2
Rendering finished.

// AngelCAD: manyballs_angelcad.as
shape@ manyballs(uint n)
{
solid@ s = sphere(25);
double delta=45;
solid@[] zs;
for(uint i=0; i<n; i++) {
double x = i*delta;
for(uint j=0; j<n; j++) {
double y = j*delta;
for(uint k=0; k<n; k++) {
double z = k*delta;
zs.push_back(translate(x,y,z)*s);
}
}
}
return union3d(zs);
}
void main()
{
shape@ obj = manyballs(n:5);
obj.write_xcsg(GetInputFullPath(),secant_tolerance:0.18);
}
// OpenSCAD: manyballs_openscad.scad
module manyballs(n)
{
$fn=25;
delta = 45;
for(i=[0:1:n-1]) {
x = i*delta;
for(j=[0:1:n-1]) {
y = j*delta;
for(k=[0:1:n-1]) {
z = k*delta;
translate([x,y,z])sphere(25);
}
}
}
}
manyballs(n=5);
Display the source blob
Display the rendered blob
Raw
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment