3
$\begingroup$

I recently meet a problem of finding the points on the boundary of a 3D object, e.g., the points on a cylinder below:

a1 = Cylinder[{{0, 0, 0}, {1, 0, 0}}, 1];Graphics3D[a1]

I'm going to work on some more complex objects, which is to be obtained by ImplicitRegion, but I guess the process should be similar.

My question is, I'd like to get a list of the boundaries points similar to what we will get in a discretization method. E.g., if I use the spherical coordinates, I may discretize the two angles and calculate the corresponding radius, or if I use the Cartesian coordinates, I may discretize z and x then seeking for the corresponding y.

So how do I get such a list of data? I prefer to get the 3D list if possible. And how do I set the desired accuracy, like the increment I set in the discretization method? My wild guess is to generate a mesh on it, e.g. using the DiscretizeRegion, but I'm not sure if it is going to work or how. Thanks a lot.

$\endgroup$
  • 1
    $\begingroup$ When you say "the points"... well, of course there is an infinite number of points on the boundary of your cylinder. What do you really want? And why? $\endgroup$ – David G. Stork Mar 6 '17 at 17:15
  • $\begingroup$ @DavidG.Stork, hi, what I mean is a list of points, that are similar to what I would obtain via a discretization method, as I described in the problem. and I would like to be able to control how the points are distributed, like I discrete the x and z values with fixed increment, and find the corresponding y, and I preferably I'd like to get a 3D list of dimension n_zn_x*3 instead of a 2D list of (n_zn_x)*3. Thanks. $\endgroup$ – larry Mar 6 '17 at 18:12
2
$\begingroup$

You can first discretize the boundary of the region with BoundaryDiscretizeRegion, and then get the points with MeshCoordinates, like so:

ClearAll[cyl, its, trans];

cyl = Cylinder[{{0, 0, 0}, {1, 0, 0}}, 1];
pts = MeshCoordinates@BoundaryDiscretizeRegion@cyl;

ListPointPlot3D[pts, BoxRatios -> {1, 1, 1}]

points

$\endgroup$
  • $\begingroup$ Hi, this is basically what I'm looking for, but if possible, I'd like to be able to control how the points are distributed, like I discrete the x and z values with fixed increment and specify their values then find the corresponding y. Do you know how to control such things? Preferably I'd like to get a 3D list of dimension n_z*n_x*3 instead of a 2D list. I guess it's probably an option of BoundaryDiscretizeRegion, e.g., the MeshCellShapeFunction or the Method? And it would be great if I could do it both in Cartesian and Spherical coordinates. Thanks. $\endgroup$ – larry Mar 6 '17 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.