Tag Info

New answers tagged

5

Let's assume you have the following points a-f, which form the line segments ab and cd and ef. a = {0, 0}; b = {3, 3}; c = {1, .5}; d = {2, 1.5}; e = {0, 2}; f = {2, 0}; In order to test whether they intersect you can use RegionIntersection. First form lines from your points, then use RegionIntersection on the two lines. Compare the intersection to an ...


1

To put Daniel's comment into code: x = Array[C, Length@First@m]; constr = First@Solve[m.x == b] (* {C[6] -> -(2/7) - C[1] - C[2] - C[3] - C[4] - C[5], <<26>>, C[56] -> -(11/21)-C[1]-C[2]-C[3]-C[7]-C[8]-C[12]-C[22]-C[23]-C[27]-C[37]} *) Reduce[Thread[x >= 0] /. constr, Variables[x /. constr]] (* False *) Easy, fast, and ...


5

I might as well add that in version 10.2 you can use the built-in functions Insphere and Circumsphere to compute the insphere and circumsphere of a tetrahedron respectively. The output of both functions are Sphere objects which can be used in Graphics3D directly. So using the tetrahedron provided by the OP we can do: pts = {{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, ...


9

Recently, I was finally able to read the wonderful book Matrices and Graphs in Geometry by Miroslav Fiedler. One of the things I learned from that book is that one can use the Cayley-Menger matrix not only for determining the volume of a simplex, but also for determining its circumsphere and insphere. What follows is a Mathematica implementation of Fiedler's ...


2

What you want is the 2D alpha shape to try to get close to the outline you seek. Of course, it's no longer a Delaunay triangulation since you're deleting certain polygons from the DelaunayMesh. We'll adopt my answer from this post. Here it is for a 2D point set: alphaShapes2D[points_, crit_] := Module[{alphacriteria, del = Quiet @ DelaunayMesh @ points, ...


1

Here is an attempt to use MichaelE2's method 2 but only using built-in functions with no need to load the FEM package. tscale = 4; θscale = 0.5; domain = DiscretizeRegion[FullRegion[2], {{0, tscale}, {0, θscale}}, MaxCellMeasure -> {"Area" -> 0.0005}] coords = g[4 Pi #1/tscale, 2 Pi #2/θscale] & @@@ ...


5

If what you want is a nice smooth surface of the outer boundary, then in Mathematica 10.2 you can do the following: data3D = RandomReal[{0, 1}, {100, 3}]; (* generate some random point *) cvx = ConvexHullMesh[data3D] (* get the outer boundary *) Now we can Discretize the surface and smooth it in one go: smooth = DiscretizeRegion[cvx, ...


5

Confirmed. These have already been implemented, but did not make it in time for the 10.2 release. DiscretizeRegion should work, however.


3

Until this is fixed in a future version, here is a workaround for now: Unprotect[RegionBoundary]; RegionBoundary /: Area @ RegionBoundary @ SphericalShell[c_, {ri_, r_}] := Area @ Sphere[c, r] + Area @ Sphere[c, ri]; RegionBoundary /: Area @ RegionBoundary @ CapsuleShape[{v1_, v2_}, r_] := 2 π r (2 r + ...


0

As recommended in comment by @ilian acap = Area@ RegionBoundary@DiscretizeRegion@CapsuleShape[{{-1, 0, 0}, {1, 0, 0}}, 1] 25.0897 Round[acap/Pi, 1/10]*Pi 8 Pi ashell = Area@ RegionBoundary@DiscretizeRegion@SphericalShell[{0, 0, 0}, {3, 4}] 313.472 Round[ashell/Pi]*Pi 100 Pi


1

In the meantime I found one way to do it. Let's say my 3d grid points are in an array grid3d[[k,i,j]], where i and j go from 1 to 8 and every element of grid3d is a triplet of {x,y,z} data, for example grid3d[[1,1,1]] is {16,16,2.3395}. My normal vectors are similarly in a norm[[k,i,j]] array and norm[[1,1,1] is {0.351765,0.113248,3.98289}, so they are not ...


8

RegionMeasure chooses a method which is slow when exact non-rational coefficients are present. I will correct this for a future version. Thanks for pointing it out. In Mathematica 10 the example works fast with approximate coefficients. In[1]:= Timing@RegionMeasure@N@ RegionIntersection[ Tetrahedron[{{0, 0, Sqrt[3/2]}, {2/Sqrt[3], 0, ...



Top 50 recent answers are included