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?
skin
in your definitions? $\endgroup$