0
$\begingroup$

The data is copied from the output cell of my original data.

pts={{25.3232,93.3884,7.90173},{25.3232,93.3884,15.6372},{25.3232,101.869,15.6372},{25.3232,101.869,7.90173},{25.6231,93.3884,7.90173},{25.6231,101.869,7.90173},{25.6231,93.3884,15.6372},{25.6231,101.869,15.6372},{25.6231,111.391,15.6372},{25.6231,111.391,7.90173},{25.923,101.869,7.90173},{25.923,111.391,7.90173},{25.923,101.869,15.6372},{25.923,111.391,15.6372}};


meshTest=ConvexHullMesh@pts

RegionResize[meshTest,10]

works properly

But in my original raw mesh, it works improperly.

ptsOrignal={{25.323178174128376`,93.38837529045934`,7.90172510421934`},{25.323178174128376`,93.38837330947786`,15.637175854060626`},{25.323178174128376`,101.86875495322009`,15.637176769628931`},{25.323178174128376`,101.86875627387441`,7.901726019787645`},{25.623105100248882`,93.38837529045934`,7.90172510421934`},{25.623105100248882`,101.86875627387441`,7.901726019787645`},{25.623105100248882`,93.38837330947786`,15.637175854060626`},{25.623105100248882`,101.86875495322009`,15.637176769628931`},{25.623105100248882`,111.39085617922113`,15.637177685197237`},{25.623105100248882`,111.39085882052977`,7.901727850924257`},{25.923034314647705`,101.86875627387441`,7.901726019787645`},{25.923034314647705`,111.39085882052977`,7.901727850924257`},{25.923034314647705`,101.86875495322009`,15.637176769628931`},{25.923034314647705`,111.39085617922113`,15.637177685197237`}};


meshTest=ConvexHullMesh@ptsOrignal

RegionResize[meshTest,10]

So is it a bug?

=== Since RegionResize is probably implemented by TransformedRegion.

This problem also happen in TransformedRegion.

TransformedRegion[meshTest,ScalingTransform[{0.01,2,0.9}]] Works Fine

TransformedRegion[meshTest,ScalingTransform[{0.01,2,0.8}]]

enter image description here

enter image description here

$\endgroup$
1
  • $\begingroup$ Strange. Remove this point and the error goes away: {25.623105100248882`, 101.86875495322009`, 15.637176769628931`} $\endgroup$
    – flinty
    Jun 11 '20 at 11:53
3
$\begingroup$

Using FindMeshDefects shows that the second example produces "tiny faces". You can use RepairMesh as clean up step to remove such errors like so:

meshTest = ConvexHullMesh@ptsOrignal
FindMeshDefects[meshTest]
meshTest = RepairMesh[meshTest];
RegionResize[meshTest, 10]

Repaired Mesh

$\endgroup$
3
  • $\begingroup$ Thanks for your digging. The bad thing is RepairMesh will sometimes broke the shape of the model. $\endgroup$ Jul 10 '20 at 7:23
  • $\begingroup$ TransformedRegion[mesh,ScalingTransform[{0.01,2,0.9}]] works fine. TransformedRegion[mesh,ScalingTransform[{0.01,2,0.8}]] failed $\endgroup$ Jul 10 '20 at 7:33
  • $\begingroup$ @HyperGroups They both worked on my machine 12.1.1 for Microsoft Windows (64-bit) (June 19, 2020) after I repaired the mesh. If you want more options to repair the mesh, have you looked at MeshLab? I posted an answer 214907 on how to decimate a mesh from Mathematica calling MeshLab. $\endgroup$
    – Tim Laska
    Jul 10 '20 at 16:09

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.