Skip to content

Instantly share code, notes, and snippets.

@arnholm
Last active October 4, 2020 08:10
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/b21e8177683687aa642b20b939648f07 to your computer and use it in GitHub Desktop.
Save arnholm/b21e8177683687aa642b20b939648f07 to your computer and use it in GitHub Desktop.

Create polyhedron from point cloud

When a polyhedron is created from an array of points, it is interpreted as a convex hull

// AngelCAD code.
shape@ main_shape(as_args@ args)
{
   array<pos3d@> hull_points = { {-1,-1,0}, {-1,1,0}, {1,1,0}, {1,-1,0}, {1/2,1,2} };
   return polyhedron(hull_points);
}

void main()
{
   shape@ obj = main_shape(GetArgs());
   obj.write_xcsg(GetInputFullPath(),secant_tolerance:-1.0);
}
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