1
$\begingroup$

I would like to ask if there is a solution to find the cross-section from ParametricPlot3D, for instance if I want the cross-section along the x-axis. Specifically, I would want to know the z-value but have no idea how I should retrieve it since I already have the x and y value.

enter image description here

Clear[u, a, b, c, d, f, t, a1, b1, c1, d1, f1]
u1 = {0, 0.1};
u2 = {1, 0};
u3 = {1.7, 1};
u4 = {2, 2};
u5 = {1.8, 2.8};

u5 = {1.8, 2.8};
u6 = {1, 3.5};

u7 = {1.5, 4.2};

u8 = {1.5, 4.5};

basis1 = ((4 - t)^3)/6;
basis2 = (((3*((t - 1)^3)) - (24*((t - 1)^2)) + (60*(t - 1)) - 44)/ 6);
basis3 = (((-3.*((t - 2)^3)) + (12.*((t - 2)^2)) - (12.*(t - 2)) + 4)/ 6);
basis4 = ((t - 3)^3)/6;

curve1 = (u1*basis1) + (u1*basis2) + (u1*basis3) + (u2*basis4);
curve2 = (u1*basis1) + (u1*basis2) + (u2*basis3) + (u3*basis4);
curve3 = (u1*basis1) + (u2*basis2) + (u3*basis3) + (u4*basis4);
curve4 = (u2*basis1) + (u3*basis2) + (u4*basis3) + (u5*basis4);
curve5 = (u3*basis1) + (u4*basis2) + (u5*basis3) + (u6*basis4);
curve6 = (u4*basis1) + (u5*basis2) + (u6*basis3) + (u7*basis4);
curve7 = (u5*basis1) + (u6*basis2) + (u7*basis3) + (u8*basis4);
curve8 = (u6*basis1) + (u7*basis2) + (u8*basis3) + (u8*basis4);
curve9 = (u7*basis1) + (u8*basis2) + (u8*basis3) + (u8*basis4);

A = ParametricPlot[{curve1, curve2, curve3, curve4, curve5, curve6, curve7, curve8, curve9}, {t, 3, 4}]

cp = ListPlot[{u1, u2, u3, u4, u5, u6, u7, u8}];

B = Show[A, cp]

a = {curve1[[1]], curve1[[2]], 0};
b = {curve2[[1]], curve2[[2]], 0};
c = {curve3[[1]], curve3[[2]], 0};
d = {curve4[[1]], curve4[[2]], 0};
f = {curve5[[1]], curve5[[2]], 0};
g = {curve6[[1]], curve6[[2]], 0};
h = {curve7[[1]], curve7[[2]], 0};
i = {curve8[[1]], curve8[[2]], 0};
j = {curve9[[1]], curve9[[2]], 0};


T = {{Cos[w], 0, Sin[w]}, {0, 1, 0}, {-Sin[w], 0, Cos[w]}};

a1 = a.T;
b1 = b.T;
c1 = c.T;
d1 = d.T;
f1 = f.T;
g1 = g.T;
h1 = h.T;
i1 = i.T;
j1 = j.T;

ParametricPlot3D[{a1, b1, c1, d1, f1, g1, h1, i1, j1}, {t, 3, 4}, {w, 
  0, Pi}, Axes -> True, AxesStyle -> {Red, Green, Blue}, 
 AxesStyle -> {Red, Green, Blue}, PlotStyle -> {Red, LightPink}, 
 Mesh -> None]

ParametricPlot3D[{a1, b1, c1, d1, f1, g1, h1, i1, j1}, {t, 3, 4}, {w, 0, Pi},
 Axes -> False, Boxed -> False, PlotStyle -> {Red, LightPink}, 
 Mesh -> None]

Thank you in advance!

$\endgroup$
0
1
$\begingroup$

You may try to set the option MeshFunctions. The following plot the surface intersected with the surface given by F[x,y,z] == 0:

F = {x, y, z} \[Function] x;
plot = ParametricPlot3D[{a1, b1, c1, d1, f1, g1, h1, i1, j1}, {t, 3, 4}, {w, 0,Pi},
    PlotStyle -> None,
    MeshFunctions -> {F},
    Mesh -> {{1}},
    MeshStyle -> {Thick}
    ];

You can turn the resulting polygonal line into a MeshRegion with

curve = DiscretizeGraphics@plot

and extract the coordinates with

MeshCoordinates[curve]
$\endgroup$

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.