1
$\begingroup$

Consider the following region:

Vol1 = Parallelepiped[{-4.75, -1.25, 
    14.5}, {{3.35, 0, 0}, {0, 2.5, 0}, {0, 0, 12}}];
Vol2 = Parallelepiped[{-4.75, -1.25, 
    14.5 + 12}, {{2.5, 0, 0}, {0, 2.5, 0}, {0, 0, 7}}];
Vol = RegionUnion[Vol1, Vol2];

It is just a merging of two parallelepipeds.

When trying to discretize the region Vol, I get the following error:

DiscretizeRegion[Vol]

DiscretizeRegion::regpnd: A non-degenerate region is expected at position 1 of DiscretizeRegion[Polyhedron[Number of points: 14 Number of faces: 11]].

The error is present on 12.1 but not on 13.XX. Could you please tell me how to remove this error?

$\endgroup$
6
  • $\begingroup$ No error in 12.3 (Windows) or 13.3 (Cloud). Which version are you using? Have you tried with vol1 = Rationalize@Parallelepiped[...]? $\endgroup$
    – Domen
    Commented Jul 24, 2023 at 9:48
  • $\begingroup$ No error in version 13.2 Windows $\endgroup$ Commented Jul 24, 2023 at 9:49
  • $\begingroup$ @DanielHuber : sorry, the version is 12.1. I will add the information. $\endgroup$ Commented Jul 24, 2023 at 9:54
  • $\begingroup$ No error in version 13.3.0 Windows 10 $\endgroup$ Commented Jul 24, 2023 at 10:40
  • 1
    $\begingroup$ @JohnTaylor, have you tried my suggestion with Rationalize? $\endgroup$
    – Domen
    Commented Jul 24, 2023 at 11:14

1 Answer 1

1
$\begingroup$

BoundaryDiscretizeRegion the region before RegionUnion.

$Version
(* "11.3.0 for Microsoft Windows (64-bit) (March 27, 2018)" *)
RegionUnion[BoundaryDiscretizeRegion@Vol1, 
 BoundaryDiscretizeRegion@Vol2]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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