4
$\begingroup$

Four copies of a flat region defined below ( length AH = 10 mm and prism Thickness= 2 mm typically) is to be 3d printed so that edges LM,KI coincide.

Writing equation of a set all straight lines in the boundary could be cumbersome. How can a multiple Region be defined copied on x-axis at 40 mm spacing using a closed polyline definition like Graphics3D[{x1,y1,0},{x2,y2,0},..] from vertices?

Thanks for all suggestions.

enter image description here

$\endgroup$
0
5
$\begingroup$

Here is an attempt at a step by step solution starting from the points in the post by @cvmgt.

pts = {{1, 0}, {3, 0}, {2, 1}, {2, 2}, {3, 3}, {4, 3}, {5, 2}, {5, 
    1}, {4, 0}, {5, 0}, {5, -1}, {1, -1}};
reg1 = WindingPolygon[pts];
RegionPlot[reg1]

enter image description here

reg2 = Region@TranslationTransform[{4, 0}][reg1];
reg3 = Region@TranslationTransform[{4, 0}][reg2];
reg4 = Region@TranslationTransform[{4, 0}][reg3];
rtot = RegionUnion[reg1, reg2, reg3, reg4];
RegionPlot[DiscretizeRegion@rtot, AspectRatio -> Automatic]

enter image description here

Now adding the depth with RegionProduct:

r3d = RegionProduct[Line[{{0.95}, {1.05}}], DiscretizeRegion@rtot];
RegionPlot3D[r3d]

enter image description here

This can be exported to a STL file for further processing in Meshlab.

\[ScriptCapitalR] = MeshRegion[r3d]
Export["C:\\fourregs.stl", \[ScriptCapitalR]]

Here is a screenshot in meshlab.

enter image description here

I would suggest that you scale it in Meshlab for 3D printing purposes. I am not conversant with 3D printing details, so I am afraid, I will have to leave it there.

$\endgroup$
2
  • 1
    $\begingroup$ Thanks, so overwhelming. Shall get back after noting the details. $\endgroup$
    – Narasimham
    Oct 2 at 20:14
  • $\begingroup$ @Narasimham r3d = RegionProduct[Line[{{0.90}, {1.1}}], DiscretizeRegion@rtot]; would give you the correct dimension in Meshlab, but verify it. Scale the polygon side to 10mm in Meshlab and the depth will fall into place at 2mm. Right now, I think it will be 1mm. Watch this video. $\endgroup$
    – Syed
    Oct 3 at 5:26
3
$\begingroup$

Do you mean this?

pts2 = {{1, 0}, {3, 0}, {2, 1}, {2, 2}, {3, 3}, {4, 3}, {5, 2}, {5, 
    1}, {4, 0}, {5, 0}, {5, -1}, {1, -1}};
pts3 = PadRight[pts2, {Automatic, 3}];
reg = Polygon[pts3];
Graphics3D[reg]

enter image description here

Edit

Thanks @Syed provide the example.

pts2 = {{1, 0}, {3, 0}, {2, 1}, {2, 2}, {3, 3}, {4, 3}, {5, 2}, {5, 
    1}, {4, 0}, {5, 0}, {5, -1}, {1, -1}};
reg2 = WindingPolygon[pts2];
reg2s = TransformedRegion[reg2, TranslationTransform[{#, 0}]] & /@ {0,
      4, 8, 12} // RegionUnion;
RegionProduct[Line[{{0.}, {1.}}], DiscretizeRegion@reg2s]

enter image description here

$\endgroup$
1
  • $\begingroup$ Yes ! Exactly what I meant this. Let me play a little more with it ! $\endgroup$
    – Narasimham
    Oct 2 at 20:17

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.