Message Boards Message Boards

0
|
8203 Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Treating BSplineCurve or BezierCurve as region in RegionPlot3D

Posted 10 years ago
I am trying to exclude a tubular parametric curve of a given thickness from a region in RegionPlot3D.  The curve cannot be defined in terms of x, y, z.  Here is the curve:
points = Transpose[{
    Table[Cos[1/2 \[Theta]], {\[Theta], 0, \[Pi],  \[Pi]/2000}],
    Table[Sin[\[Theta]]^2, {\[Theta], 0, \[Pi],  \[Pi]/2000}],
    Table[Sin[3 \[Theta]]^3, {\[Theta], 0, \[Pi],  \[Pi]/2000}]}];
Graphics3D[{Thickness[0.02], BSplineCurve[points]}]

I have explored using BezierFunction and BSpline to no avail.  The best I can manage is to use Show with Graphics3D and RegionPlot3D, but this does not treat the curve as a region.  Is there a way to represent the curve as a region?
My current workaround is using many thousands of inequalities to create a spherical region around each data point on the curve, but it's tedious and slow.
POSTED BY: Bryan Lettner
4 Replies
Posted 10 years ago
I am not sure how the /@  and @ work in the solution above.  Is there a tutorial that explains @ and /@ ?
POSTED BY: Bryan Lettner
Posted 10 years ago
Posted 10 years ago
Grisha I appreciate your effort and response.  That's exactly what I am going for.
POSTED BY: Bryan Lettner
Is it what you want?
points = Transpose[{Table[
     Cos[1/2 \[Theta]], {\[Theta], 0, \[Pi], \[Pi]/2000}],
    Table[Sin[\[Theta]]^2, {\[Theta], 0, \[Pi], \[Pi]/2000}],
    Table[Sin[3 \[Theta]]^3, {\[Theta], 0, \[Pi], \[Pi]/2000}]}];

Graphics3D[Tube[BSplineCurve[points], 0.02]]

You can also use RegionPlot3D approximately:
npts = 200;
nf = Nearest[BSplineFunction[points] /@ Range[0, 1, 1/npts]];
thickness = 0.1;

RegionPlot3D[EuclideanDistance[First@nf[{x, y, z}], {x, y, z}] < thickness,
{x, 0 - thickness, 1 + thickness}, {y, 0 - thickness, 1 + thickness}, {z, -1 - thickness, 1 + thickness},
PlotPoints -> npts/4, PlotStyle -> Directive[Yellow, Opacity[0.5]],
Mesh -> None, BoxRatios -> {(1 + 2 thickness)/(2 + 2 thickness), (1 + 2 thickness)/(2 + 2 thickness), 1}]
POSTED BY: Grisha Kirilin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract