19 #ifndef vsr_cyclide_INC
20 #define vsr_cyclide_INC
24 namespace vsr {
namespace cga {
38 circle[0] = (sphere[1].dual() ^ sphere[2].dual()).dual();
39 circle[1] = (sphere[0].dual() ^ sphere[2].dual()).dual();
40 circle[2] = (sphere[0].dual() ^ sphere[1].dual()).dual();
50 tframe[0].frame.
pos() = a;
51 tframe[1].frame.
pos() = b;
52 tframe[2].frame.
pos() = c;
53 tframe[3].frame.
pos() = d;
63 tframe[0].bitan[0] = tframe[0].frame.
tx().dual();
64 tframe[0].bitan[1] = tframe[0].frame.
ty().dual();
65 tframe[0].bitan[2] = tframe[0].frame.
tz().dual();
67 for (
int j=0;j<3;++j){
68 tframe[0].
sphere[j] = tframe[0].bitan[j] ^ tframe[1].frame.
pos();
72 for (
int i=1;i<4;++i){
73 int next = ( i < 3 ) ? i+1 : 0;
74 for (
int j=0;j<3;++j){
75 tframe[i].bitan[j] =
Tangent::at( tframe[i-1].sphere[j], tframe[i].frame.pos() );
76 tframe[i].
sphere[j] = tframe[i].bitan[j] ^ tframe[next].frame.
pos();
77 tframe[i].tan[j] = tframe[i].bitan[j].undual();
82 for (
int i=0;i<4;++i) tframe[i].calcCurves();
87 auto dotU = ( tframe[0].frame.
pos() <= tframe[2].
sphere[0].dual() )[0];
93 auto dotV = ( tframe[0].frame.
pos() <= tframe[1].
sphere[1].dual() )[0];
99 mLogU =
Gen::log(
Gen::ratio(tframe[0].sphere[0].dual(), tframe[2].sphere[0].dual(),
true ), altU() );
100 mLogV =
Gen::log(
Gen::ratio(tframe[3].sphere[1].dual(), tframe[1].sphere[1].dual(),
true ), altV() );
104 mLogNu =
Gen::log(
Gen::ratio( tframe[0].sphere[2].dual(), tframe[2].sphere[2].dual(),
true ),
false );
105 mLogNv =
Gen::log(
Gen::ratio( tframe[3].sphere[2].dual(), tframe[1].sphere[2].dual(),
true ),
false );
109 Bst xfu( VSR_PRECISION u ){
return Gen::bst(mLogU * -u ); }
110 Bst xfv( VSR_PRECISION v ){
return Gen::bst(mLogV * -v ); }
113 Con xf( VSR_PRECISION u, VSR_PRECISION v) {
return xfv(v) * xfu(u); }
115 Circle cirU( VSR_PRECISION u) {
return tframe[0].
circle[1].
spin( xfu(u) ); }
116 Circle cirV( VSR_PRECISION v) {
return tframe[3].
circle[0].
spin( xfv(v) ); }
120 T
apply(
const T& t, VSR_PRECISION u, VSR_PRECISION v) {
121 return t.spin( xf(u,v) );
124 Vec evalNormal( VSR_PRECISION u, VSR_PRECISION v){
125 auto tan =
apply( tframe[0].frame.tz(), u,v);
132 return Round::loc( tframe[0].frame.pos().spin( xf(u,v) ) );
static Bst bst(const Pair &p)
vsr::cga::Boost from vsr::cga::Pair
Par tx() const
Null Point Pair in local x direction.
NCon< 5 > Con
ConformalRotor
Definition: vsr_cga3D_types.h:95
static DirectionVector direction(const Pair &p)
Direction of a Pair.
Point eval(VSR_PRECISION u, VSR_PRECISION v)
Apply conformal rotor to a point at u,v.
Definition: vsr_cyclide.h:131
Point pos() const
Get Position.
Definition: vsr_cga3D_frame.h:138
Multivector spin(const MultivectorB< B > &b) const
Rotor (even) transformation \(RA\tilde{R}\)
Definition: vsr_multivector.h:178
Generic Geometric Number Types (templated on an algebra and a basis )
Definition: vsr_algebra.h:69
Circle circle[3]
circle through next point
Definition: vsr_cyclide.h:32
static Point loc(const A &s)
Location (normalizd) of a Round Element (shorthand)
Definition: vsr_cga3D_round.h:146
TangentFrame tframe[4]
– four frames
Definition: vsr_cyclide.h:47
T apply(const T &t, VSR_PRECISION u, VSR_PRECISION v)
Apply conformal rotor to a type T at u,v.
Definition: vsr_cyclide.h:120
NBst< 5 > Bst
Boost
Definition: vsr_cga3D_types.h:94
Cir Circle
Direct Circle 3-blade \(\kappa=p_a \wedge p_b \wedge p_c\)
Definition: vsr_cga3D_types.h:130
static Pair at(const Circle &r, const Point &p)
Tangent Element of A Circle at Point p.
Cylclidic Net (four tangent frames)
Definition: vsr_cyclide.h:45
static Rot ratio(const Vec &v, const Vec &v2)
vsr::cga::Rotor that takes one vec to another
the versor library namespace
Definition: vsr_algebra.h:29
B copy() const
Copying to type B.
Par ty() const
Null Point Pair in local y direction.
static Biv log(const Rot &r)
vsr::cga::Bivector log of vsr::cga::Rotor
Orthonormal Frame composed from a Position and Orientation.
Definition: vsr_cga3D_frame.h:47
Sphere sphere[3]
sphere through next point
Definition: vsr_cyclide.h:31
Frame Tangent to Surface.
Definition: vsr_cyclide.h:28
Pair mLogV
– two bivectors
Definition: vsr_cyclide.h:56
Pair mLogNv
– two more (normals)
Definition: vsr_cyclide.h:57
Par tz() const
Null Point Pair in local z direction.
Definition: vsr_cyclide.h:140