6
$\begingroup$

I am trying to construct some 3D printable parts using discretized regions, and am curious if there is a good means to transform a well-designed 2D region into a corresponding 3D region extended straight in the z-axis (e.g. triangle to prism). It seems that using the 'same' methodology to make a 3D region causes a severe loss in resolution compared to 2D.

rs = 1;
n = 10;
rb = n*rs;
p = ((rb - rs) {Cos[\[Theta]], Sin[\[Theta]]} + (rs) {Cos[n*\[Theta]], -Sin[n*\[Theta]]});
P2D = ParametricPlot[p, {\[Theta], 0, 2 \[Pi]}];
R2D = DiscretizeRegion[ParametricRegion[r*p, {{\[Theta], 0, 2 \[Pi]}, {r, 0, 1}}], MaxCellMeasure -> 1/10, AccuracyGoal -> 10];
R3D = DiscretizeRegion[ParametricRegion[{0, 0, z} + r*Append[p, 0], {{\[Theta], 0, 2 \[Pi]}, {r, 0, 1}, {z, 0, 1}}], MaxCellMeasure -> 1/10, AccuracyGoal -> 10];
Row[{P2D, R2D, R3D}]

Parametric Plot, 2D Region, 3D region

$\endgroup$
1
  • $\begingroup$ The curve is self intersection at the corners. It make the 2D region more complex. $\endgroup$
    – cvgmt
    Commented Jun 24 at 10:08

1 Answer 1

14
$\begingroup$
RegionProduct[R2D, Line[{{0.}, {2.}}]]

enter image description here

$\endgroup$
1
  • $\begingroup$ Wow, this is perfect! I can't believe I missed this command. $\endgroup$
    – ChaSta
    Commented Jun 24 at 13:00

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