# RegionIntersection for big mesh, AnatomyData["skin","MeshRegion"]

I want to cut a human in half.

Say skin=Entity["AnatomicalStructure","Skin"].

So, reg=AnatomyData[skin,"MeshRegion"] is the skin of a human, with about 369000 triangles among 185000 points.

In theory, RegionIntersection[reg,Cuboid[{-400,-400,-100},{400,400,810}]] should yield the lower half of skin (the numbers specified by me, knowing the RegionBounds). The resultant mesh doesn't work with TriangulateMesh: is there a way to do this with stock MMA? If no, how best to do it with a FEM package?

Alternatively, we can simply remove those upper-half vertices. So

primitives=AnatomyData[skin,"Graphics3DPrimitives"][[1]];
With[{invalidpts = Join@@Position[primitives[[1,1]],
{_,_,x_} /; x<800]},
ReplacePart[primitives, {1,2,1,1} ->
DeleteCases[
skinprimitives[[1,2,1,1]], {___, Alternatives @@ invalidpts, ___}]
]


should yield the chopped human, but takes painfully long on my computer (I don't know if it terminates). Is there a good way to make this code more efficient?

• Can you include the InputForm you obtained for skin in your definitions? Jan 11, 2022 at 3:51

ClipPlanes can clip the region by half-spaces a*x+b*y+d*z+d<=0.
Since the normal of such hyperplane a*x+b*y+d*z+d==0 is {a,b,c}, so the hyperplane which pass through one point {x0,y0,z0} is {a,b,c}.({x,y,z}-{x0,y0,z0})=0.It means that we can set d=-{a,b,c}.{x0,y0,z0}.
human = AnatomyData[Entity["AnatomicalStructure", "Skin"],