Re: Intersect Point of a 3D Parametric Line & B-Spline Surface
- To: mathgroup at smc.vnet.net
- Subject: [mg132170] Re: Intersect Point of a 3D Parametric Line & B-Spline Surface
- From: Bob Hanlon <hanlonr357 at gmail.com>
- Date: Thu, 9 Jan 2014 01:50:50 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
- References: <20140108035226.99D546A06@smc.vnet.net>
paraLine = ParametricPlot3D[
{2 + t, 2 + 3 t, 2 t},
{t, -1, 1},
PlotRange -> {{0, 5}, {0, 5}, {-1, 1}},
PlotStyle -> {Red, Thickness[0.004]},
ViewPoint -> {4, 2, 1},
AxesLabel -> {"X", "Y", "Z"},
Background -> LightYellow,
ImageSize -> 500];
cpts = {{
{1, 1, -0.5740579178735179`}, {1, 2, 0.3902669640296943`},
{1, 3, 0.6162142022057271`}, {1, 4, -0.11572153782589911`},
{1, 5, 0.436662579150056`}},
{{2, 1, 0.8096824307907462`}, {2, 2, -0.7419265507701529`},
{2, 3, -0.8659156744537175`}, {2, 4, -0.0998628811371658`},
{2, 5, -0.24185346526195106`}},
{{3, 1, -0.1969086942688163`}, {3, 2, 0.7961076758026819`},
{3, 3, -0.060290070096196136`}, {3, 4, 0.48665856202059254`},
{3, 5, -0.013419247141178037`}},
{{4, 1, 0.6573342854316904`}, {4, 2, -0.9170657725998455`},
{4, 3, 0.9830103505987027`}, {4, 4, -0.8759376369982923`},
{4, 5, -0.03030297194593956`}},
{{5, 1, -0.549653902873303`}, {5, 2, 0.7865815336945703`},
{5, 3, -0.6672322036832838`}, {5, 4, 0.5688838564868042`},
{5, 5, 0.5541079809436917`}}};
surf = Graphics3D[BSplineSurface[cpts]];
f = BSplineFunction[cpts];
gx[u_?NumericQ, v_?NumericQ] := f[u, v][[1]];
gy[u_?NumericQ, v_?NumericQ] := f[u, v][[2]];
gz[u_?NumericQ, v_?NumericQ] := f[u, v][[3]];
ip = FindRoot[{
x == 2 + t == gx[u, v],
y == 2 + 3 t == gy[u, v],
z == 2 t == gz[u, v]},
{{x, 2}, {y, 2}, {z, 0}, {t, 0},
{u, .2, 0, 1}, {v, .2, 0, 1}}]
{x -> 1.95648, y -> 1.86945, z -> -0.0870339, t -> -0.043517, u ->
0.191361,
v -> 0.170743}
{x, y, z} == {2 + t, 2 + 3 t, 2 t} == f[u, v] /. ip
True
Show[paraLine, surf]
Show[paraLine, ParametricPlot3D[f[u, v], {u, 0, 1}, {v, 0, 1}]]
Bob Hanlon
On Tue, Jan 7, 2014 at 10:52 PM, Bill <WDWNORWALK at aol.com> wrote:
> Hi:
>
> I have the following Mathematica 8.0.4. code that plots a parametric 3D
> line and a surface using BSplineSurface.
>
> paraLine=ParametricPlot3D[{2+t,2+t 3,t 2}, {t,-1,1},PlotRange -> {{0,
> 5},{0, 5},{-1, 1}}, PlotStyle->{Red,Thickness[0.004]},ViewPoint->{4,2,1},
> AxesLabel -> {"X", "Y", "Z"},Background->LightYellow,ImageSize->500];
>
> cpts={{{1,1,-0.5740579178735179`},{1,2,0.3902669640296943`},{1,3,0.6162=
142022057271`},{1,4,-0.11572153782589911`},{1,5,0.436662579150056`}},{{2,1,=
0.8096824307907462`},{2,2,-0.7419265507701529`},{2,3,-0.8659156744537175`},=
{2,4,-0.0998628811371658`},{2,5,-0.24185346526195106`}},{{3,1,-0.1969086942=
688163`},{3,2,0.7961076758026819`},{3,3,-0.060290070096196136`},{3,4,0.4866=
5856202059254`},{3,5,-0.013419247141178037`}},{{4,1,0.6573342854316904`},{4=
,2,-0.9170657725998455`},{4,3,0.9830103505987027`},{4,4,-0.8759376369982923=
`},{4,5,-0.03030297194593956`}},{{5,1,-0.549653902873303`},{5,2,0.786581533=
6945703`},{5,3,-0.6672322036832838`},{5,4,0.5688838564868042`},{5,5,0.55410=
79809436917`}}};
> surf=Graphics3D[BSplineSurface[cpts]];
> Show[paraLine,surf]
>
>
> Question: How can the intersect point coordinates of the line and surface
> be found by using Mathematica?
>
> I think the Mathematica code maybe something like this:
>
> NSolve[x==2+t && y==2+t 3 && z==t 2 && (?),{x,y,z,t}]
>
> but I don't know how to enter the BSplineSurface.
>
>
> Thanks,
>
> Bill W.
>
>
- References:
- Intersect Point of a 3D Parametric Line & B-Spline Surface
- From: Bill <WDWNORWALK@aol.com>
- Intersect Point of a 3D Parametric Line & B-Spline Surface