Message Boards Message Boards

1
|
4948 Views
|
8 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Built-in symbols and functions for numerical 3D geometry?

Posted 3 years ago

I have numerical data for 3D surfaces that I wish to mutually crop; i.e. crop the front and back with the left, right, top, and bottom - and similarly for the other 2 permutations. Afterwards, I will join these to make the surface of a volume. And later, I'll want to take unions and intersections of these volume surfaces.

What Built-in or supported-package symbols and functions can I use instead of writing my own package?

Here is some example low-resolution data:

(* Coordinate #1 is vertical, #2 is left to right, #3 is front to \
rear. *)
surfacenames = {"front", "back", "left", "right", "bottom", "top"};
lowressurfaces = {{{0., -0.7929, -1.1203}, {0., 0.0713, -1.1203}, {0.,
      0.9355, -1.1203}, {0.5, -0.7929, -0.7892}, {0.5, 
     0.0713, -0.7836}, {0.5, 
     0.9355, -1.1203}, {1., -0.7929, -0.4353}, {1., 
     0.0713, -1.1203}, {1., 0.9355, 0.027200}}, {{0., -0.7929, 
     0.8793}, {0., 0.0713, 0.8793}, {0., 0.9355, 
     0.8793}, {0.5, -0.7929, 0.5014}, {0.5, 0.0713, 0.8627}, {0.5, 
     0.9355, 0.7277}, {1., -0.7929, 0.9339}, {1., 0.0713, 
     0.9339}, {1., 0.9355, 
     0.9339}}, {{0., -0.7915, -1.1203}, {0., -0.7915, -0.0932}, {0., \
-0.7915, 0.9339}, {0.5, -0.7929, -1.1203}, {0.5, -0.7929, -0.0932}, \
{0.5, -0.7929, 
     0.9339}, {1., -0.5625, -1.1203}, {1., -0.7707, -0.0932}, {1., \
-0.7929, 0.9339}}, {{0., 0.9355, -1.1203}, {0., 0.9355, -0.0932}, {0.,
      0.9355, 0.9339}, {0.5, 0.9355, -1.1203}, {0.5, 
     0.9355, -0.0932}, {0.5, 0.9277, 0.9339}, {1., 
     0.9355, -1.1203}, {1., 0.9355, -0.0932}, {1., 0.9355, 
     0.9339}}, {{0., -0.7929, -1.1203}, {0., -0.7929, -0.0932}, {0., \
-0.7929, 0.9339}, {0., 0.0713, -1.1203}, {0., 0.0713, -0.0932}, {0., 
     0.0713, 0.9339}, {0., 0.9355, -1.1203}, {0., 
     0.9355, -0.0932}, {0., 0.9355, 
     0.9339}}, {{0.8992, -0.7929, -1.1203}, {0.9730, -0.7929, \
-0.0932}, {1., -0.7929, 0.9339}, {0.9860, 0.0713, -1.1203}, {1., 
     0.0713, -0.0932}, {1., 0.0713, 0.9339}, {1., 
     0.9355, -1.1203}, {1., 0.9355, -0.0932}, {1., 0.9355, 0.9339}}};
POSTED BY: Richard Frost
8 Replies

See RegionUnion, RegionIntersection, MeshRegion etc. There is a distinction between 'shells and blobs', so depending on the meshes you end up with, you may need to convert blobs to their boundaries and back. https://mathematica.stackexchange.com/questions/226735/how-to-fill-in-interior-in-a-mesh-region might be useful for this.

Cheers!

POSTED BY: Adam Mendenhall

Hi Adam, I had previously looked at MeshRegion as described in this guide: https://reference.wolfram.com/language/guide/MeshRegions.html

Unfortunately, the constructors that use points (e.g. ConvexHullMesh) all produce surfaces that bound volumes. For example, using the data above:

s2 = ConvexHullMesh[lowressurfaces[[2]]]

Instead, I am working with surfaces - in the case of s2 the surface "above" plane #1 x #2. So I believe correct kind of Region is Polygon.

I've looked at operations on Regions in the following guide but unable to locate anything related to region cropping: https://reference.wolfram.com/language/guide/DerivedRegions.html

POSTED BY: Richard Frost

Here's another look at the surfaces in medium resolution:

POSTED BY: Richard Frost

This may be a start:

Map[ListPlot3D[#, Mesh -> All] &, lowressurfaces]
POSTED BY: Gianluca Gorni

Thank you Gianluca. My objective though is not visualization but instead cropping these lattices for follow-on computations. One approach to cropping I'm exploring is iteration through each surface and discarding lattice points outside the bounds of the 4 complementary surfaces. A second approach is to create a Polygon surface from each of the 6 surface lattices, then for each polygonalized surface find the Built-in intersection of the 4 compliment surfaces, and use these intersections for boundaries of each surface lattice. Either way, once completed I can take the union of the surfaces and begin computation of the unusual voxels within the volume.

POSTED BY: Richard Frost

This procedure turns a plot into a Polyhedron object:

pl = ListPlot3D[lowressurfaces[[2]], Mesh -> All];
cmplx = Cases[pl, _GraphicsComplex, All][[1]];
polhdr = Polyhedron[cmplx[[1]], 
  Cases[cmplx, Polygon[pts_] :> pts, All][[1]]]
POSTED BY: Gianluca Gorni

POSTED BY: Richard Frost

POSTED BY: Richard Frost
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract