FuncViz examples
Generalized bitree/quadtree/octree library
|
Parametric curve as the intersection of two parametric surfaces. More...
Go to the source code of this file.
Parametric curve as the intersection of two parametric surfaces.
Copyright (c) 2024, Mitchell Jay Richling http://www.mitchr.me/ All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This program produces an interesting visualization of an object known as the twisted cubic. In parametric form, the curve may be expressed as
\[ f(t)=[t, t^2, t^3] \]
Alternately the curve is also the intersection of two surfaces in \(\mathbb{R}^3\):
\[ y=f_2(x, z)=y^2 \]
\[ z=f_3(x, y)=x^3 \]
The "typical" way to graph a surface like \(f_2\) is to transform it into pseudo-parametric form. In Maple that might look like this
plot3d([u, u^2, v], u=-1..1, v=-1..1):
We could do that with MRPTree, but it is easier to simply map the variables when we use construct_geometry_fans().
Another interesting use of MRPTree in this example is the way we have transformed each surface function into an SDF to drive up sample resolution near the surface intersection. This would allow us to use a tool like Paraview to compute an approximation to the the intersection. Just in case the reader is not using a tool that can extract a nice surface intersection, I have also dumped the curve out in a 3rd .VTU file.
Definition in file parametric_curve_3d.cpp.