Is there a way to take two arbitrary BSplineCurves and create a loft surface? I would like to then create a mesh to send to NDSolveValue.
2 Answers
Clear["`*"];
f = BSplineFunction[RandomReal[{-1, 1}, {4, 3}]];
g = BSplineFunction[RandomReal[{-1, 1}, {3, 3}]];
movingline = ParametricPlot3D[f[u], {u, 0, 1}, PlotStyle -> Red];
baseline =
ParametricPlot3D[g[v] + f[0] - g[0], {v, 0, 1}, PlotStyle -> Blue];
surface =
ParametricPlot3D[g[u] + f[v] - g[0], {u, 0, 1}, {v, 0, 1},
MeshFunctions -> (#4 &), MeshStyle -> Pink,
PlotStyle -> LightGreen, PlotRange -> All];
Show[surface, baseline, movingline, Boxed -> False]
ToBoundaryMesh
is also work, so it can be use in FEM
reg = DiscretizeGraphics[surface]
<< NDSolve`FEM`
loftmesh = ToBoundaryMesh[reg]
loftmesh["Wireframe"]
Do you mean something like this?
acc = 10
curv1 = Table[{Cos[u], Sin[u], 1.}, {u, Subdivide[0, 2 Pi - 2 Pi/acc, acc]}];
curv2 = Table[{.2 Cos[u], .2 Sin[u], -1.}, {u,Subdivide[0, 2 Pi - 2 Pi/acc, acc]}];
sur = BSplineSurface[{curv1, curv2}, SplineClosed -> {False, True}, SplineDegree -> 3];
surfun = BSplineFunction[{curv1, curv2}, SplineClosed -> {False, True}, SplineDegree -> 3];
Graphics3D[sur]
Generating the Mesh then from surfun
should be straight forward.
-
$\begingroup$ Thanks guys! I don't know why it was so hard to cypher this out of the help structure. This has me going in the right direction! Best! $\endgroup$ Oct 13, 2020 at 22:27