#include <View.H> #include <TensorBlossom.H> using namespace xchen; void srf_cmpl(View* v) { TensorBlossom<1,3> *boundary = new TensorBlossom<1,3>(3, 6); boundary->ControlMesh() = E3( -0.697368, 0.639803, 0 ), E3( -0.486842, 0.639803, 0 ), E3( -0.486842, -0.360197, 0 ), E3( 0.578947, -0.360197, 0 ), E3( 0.575658, -0.521382, 0 ), E3( -0.697368, -0.521382, 0 ); boundary->SetPeriodicEnd(); TensorBlossom<1,3> *maxis = new TensorBlossom<1,3>(1, 6); E3 mpoint0 = E3( -0.565789, -0.416118, 0 ), mpoint1 = E3( -0.575658, 0.541118, 0 ), mpoint2 = mpoint1, mpoint3 = mpoint0, mpoint4 = E3( 0.490132, -0.439145, 0 ), mpoint5 = mpoint4; maxis->ControlMesh() = mpoint0, mpoint1, mpoint2, mpoint3, mpoint4, mpoint5; maxis->SetPeriodicEnd(); TensorBlossom<2,3> *srf = new TensorBlossom<2,3>(ruled, boundary, maxis); new glModel(v, srf); TensorBlossom<1,3> *refined_maxis = new TensorBlossom<1,3>(1, 6); E3 rmpoint0 = E3( -0.391447, -0.254934, 0 ), rmpoint1 = E3( -0.575658, -0.0904605, 0 ), rmpoint2 = E3( -0.592105, 0.277961, 0 ), rmpoint2a = E3( -0.585526, 0.449013, 0 ), rmpoint3 = E3( -0.595395, 0.603618, 0 ), rmpoint4 = rmpoint3, rmpoint4a = rmpoint2a, rmpoint5 = rmpoint2, rmpoint6 = rmpoint1, rmpoint7 = rmpoint0, rmpoint8 = E3( -0.223684, -0.425987, 0 ), rmpoint9 = E3( 0.190789, -0.442434, 0 ), rmpoint9a = E3( 0.348684, -0.445724, 0 ), rmpoint10 = E3( 0.532895, -0.442434, 0 ), rmpoint11 = rmpoint10, rmpoint11a= rmpoint9a, rmpoint12 = rmpoint9, rmpoint13 = rmpoint8, rmpoint14 = rmpoint0; refined_maxis->ControlMesh() = rmpoint0, rmpoint2a, rmpoint4a, rmpoint7, rmpoint9a, rmpoint11a; refined_maxis->SetPeriodicEnd(); TensorBlossom<2,3> *refined_srf = new TensorBlossom<2,3>(ruled, boundary, refined_maxis); new glModel(v, refined_srf); boundary->Subdivide(5); new glModel(v, boundary); } void new_glModel(View* v) { srf_cmpl(v); } // point1 : pt( -0.697368, -0.521382, 0 ); // point2 : pt( -0.697368, 0.639803, 0 ); // point3 : pt( -0.486842, 0.639803, 0 ); // point4 : pt( -0.486842, -0.360197, 0 ); // point5 : pt( 0.578947, -0.360197, 0 ); // point6 : pt( 0.575658, -0.521382, 0 ); // curve1 : curve( 2, "ec_periodic", "kv_uniform", array( point1, point2, point3, point4, point5, point6 ) ); // mpoint0 : pt( -0.565789, -0.416118, 0 ); // mpoint1 : pt( -0.575658, 0.541118, 0 ); // mpoint2 : mpoint1; // mpoint3 : mpoint0; // mpoint4 : pt( 0.490132, -0.439145, 0 ); // mpoint5 : mpoint4; // mcurve1 : curve(2,"ec_periodic", "kv_uniform", array(mpoint0,mpoint1,mpoint2,mpoint3,mpoint4,mpoint5)); // srf1 : ruledSrf(curve1,mcurve1); // isocrv10: crvInSrf(srf1,"row",0); // show(isocrv10); // isocrv11: crvInSrf(srf1,"row",.25); // show(isocrv11); // isocrv12: crvInSrf(srf1,"row",.5); // show(isocrv12); // isocrv13: crvInSrf(srf1,"row",.75); // show(isocrv13); // isocrv14: crvInSrf(srf1,"row",1.0); // show(isocrv14); // curve4 : curve( 4, "ec_periodic", "kv_uniform", array( point1, point2, point3, point4, point5, point6 ) ); // open_mcurve1:crvOpen(mcurve1); // raised_mcurve1:raiseCrvOrder(open_mcurve1,4); // open_curve4:crvOpen(curve4); // ref_curve4: cRefine(open_curve4,cKv(raised_mcurve1),false); // surf4: ruledSrf(ref_curve4,raised_mcurve1); // isocrv0: crvInSrf(surf4,"row",0); // show(isocrv0); // isocrv1: crvInSrf(surf4,"row",.25); // show(isocrv1); // isocrv2: crvInSrf(surf4,"row",.5); // show(isocrv2); // isocrv3: crvInSrf(surf4,"row",.75); // show(isocrv3); // isocrv4: crvInSrf(surf4,"row",1.0); // show(isocrv4); // rmpoint0 :pt( -0.391447, -0.254934, 0 ); // rmpoint1 :pt( -0.575658, -0.0904605, 0 ); // rmpoint2 :pt( -0.592105, 0.277961, 0 ); // rmpoint2a: pt( -0.585526, 0.449013, 0 ); // rmpoint3 :pt( -0.595395, 0.603618, 0 ); // rmpoint4 :rmpoint3; // rmpoint4a:rmpoint2a; // rmpoint5 :rmpoint2; // rmpoint6 :rmpoint1; // rmpoint7 :rmpoint0; // rmpoint8 :pt( -0.223684, -0.425987, 0 ); // rmpoint9 :pt( 0.190789, -0.442434, 0 ); // rmpoint9a: pt( 0.348684, -0.445724, 0 ); // rmpoint10 :pt( 0.532895, -0.442434, 0 ); // rmpoint11 :rmpoint10; // rmpoint11a: rmpoint9a; // rmpoint12 :rmpoint9; // rmpoint13 :rmpoint8; // rmpoint14 :rmpoint0; // refined_mcurve: curve(2,"ec_periodic","kv_uniform",array(rmpoint0,rmpoint2a,rmpoint4a,rmpoint7, rmpoint9a, rmpoint11a)); // open_refined_mcurve: crvOpen(refined_mcurve); // raised_refined_mcurve: raiseCrvOrder(open_refined_mcurve,4); // refined_srf: srfFromShell(ruledSrf(ref_curve4,raised_refined_mcurve,false),0); // risocrv0: crvInSrf(refined_srf,"row",0); // show(risocrv0); // risocrv1: crvInSrf(refined_srf,"row",.25); // show(risocrv1); // risocrv2: crvInSrf(refined_srf,"row",.5); // show(risocrv2); // risocrv3: crvInSrf(refined_srf,"row",.75); // show(risocrv3); // risocrv4: crvInSrf(refined_srf,"row",1.0); // show(risocrv4);
1.2.18