Surface construction using two line segment
have two line segment in the space, how to construct a surf开发者_高级运维ace with two line segment as the boundary?
You may do this parametrically.
Supose your two segments described by:
{s1(t)} = t {a1} + {b1} (0 <= t <= 1)
{s2(t)} = t {a2} + {b2} (0 <= t <= 1)
where the {} indicates vector quantities, {a},{b} constants.
Then, for any t you have two points in space, one in each segment.
The straight line between them can be described by:
{r(v)} = ({s2(t)} - {s1(t)}) v + {s1(t)} (0 <= v <= 1 )
We are almost there. Now we write the function describing the surface, replacing s1 and s2 by their values:
{K(v,t)} = t v ( {a2} - {a1} )+ v ({b2} - {b1}) + t {a1} + {b1} (0<= t,v <=1)
HTH!
Edit
An Example:
a1 = {1, 1, 1};
b1 = {0, 0, 0};
a2 = {1, 1, 0};
b2 = {0, 0, 0};
Show[ParametricPlot3D[
t v a1 (a2 - a1) + v (b2 - b1) + t a1 + b1, {t, 0, 1}, {v, 0, 1},
AxesLabel -> {"x", "y", "z"}],
Graphics3D[{Thick, Red, Line[{b1, a1 + b1}]}],
Graphics3D[{Thick, Red, Line[{b2, a2 + b2}]}]]
Another example, showing a non-flat surface:
a1 = {1, 1, 1};
b1 = {0, 0, 1};
a2 = {1, 0, 0};
b2 = {0, 1, 0};
The two line segments will have to be co-planar (ie: both lie on the surface you want to reconstruct). A cross-product of the two line segments will give you the normal to the surface (a vector perpendicular to the surface).
What I'm not sure about at this point is what you mean by the line segments determining the boundary. If the ends of the line segments are the 4 points of a quad boundary and you want to turn that into a subdivided patch, then you can bilinearly interpolate between the corner points to produce the coordinates for your patch mesh.
精彩评论