I have a shape that is a knuckle plate with two holes cut in it, thus:

center1 = {0, 0};
center2 = {8, 0};
radius1 = 4;
radius2 = 3;
arc1 = Circle[center1, radius1, { -1 angle1, 2 \[Pi] + angle1}];
arc2 = Circle[center2, radius2, { -1 angle2, angle2}];
endpoint1 = {x1, y1};
endpoint2 = {x2, y2};
tangent = {endpoint1, endpoint2} /. 
   Solve[{(endpoint2 - center2).(endpoint2 - endpoint1) == 
      0, (endpoint1 - center1).(endpoint2 - endpoint1) == 
      0, (endpoint1 - center1).(endpoint1 - center1) == 
      radius1^2, (endpoint2 - center2).(endpoint2 - center2) == 
      radius2^2, (endpoint1 - center1).(endpoint2 - center2) > 
      0}, {x1, y1, x2, y2}, Reals];
angle1 = ArcTan[tangent[[1, 1, 2]]/tangent[[1, 1, 1]]];
angle2 = ArcTan[tangent[[2, 1, 2]]/tangent[[2, 1, 1]]];
bores = Circle[#, 1] & /@ {center1, center2};
Graphics[{arc1, arc2, Line[tangent], bores}]

knuckle plate

I want to be able create a region which is defined by the perimeter of the knuckle plate subtracted by the holes. I started to do this and ran into problems:

plate = RegionUnion[arc1, arc2, Line[tangent]];
platemesh = BoundaryDiscretizeRegion[plate];

This gives errors such as "There is not a boundary representation that uniquely defines a region with region dimension 1 embedded in dimension 2". (Note that I am hoping for a general answer that would work for any set of connected lines and arcs, not just a convex shape.)

Note on potential duplicates:

Solutions that involve ConvexHull are not applicable as explained above

Solution from a related post:


Involves flattening of the line segments into discrete points, which for a complex set of paths could be complicated. Ideally, I am looking for a solution that computes the region using the paths as the primary inputs without having to break those paths into more primitive objects.

  • 1
    $\begingroup$ It would seem to me that the answers you received and contributed yourself to your very similar previous question from yesterday should apply here as well. $\endgroup$ – MarcoB Aug 13 '15 at 15:15
  • $\begingroup$ @Tyler Durden: If the goal is to create a FEM mesh, then you can try the following. In step platemesh = BoundaryDiscretizeRegion[plate] instead of BoundaryDiscretizeRegion[plate] use DiscretizeRegion[plate]. In the next step you can use either directly ToElementMesh[] included the option MeshQualityGoal -> 0.1 or before that ToBoundaryMesh[] and then build the element mesh. $\endgroup$ – ronin2222 Jul 14 at 9:27

I am using all your definitions, except for bores, which I modified to use Disk instead of Circle:

bores = Disk[#, 1] & /@ {center1, center2};

   Disk[center1, radius1],
   Disk[center2, radius2],

Mathematica graphics

| improve this answer | |
  • 1
    $\begingroup$ This solves the immediate problem, but does not answer the question of how to create a region from a set of connected arcs and line segments. $\endgroup$ – Tyler Durden Aug 13 '15 at 16:17

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