Spiral surfaces.

 

Let's create a spiral surface with an arc-clip.

 

This code creates an arc:

 

SG_ARC   ArcGeo;

 SG_POINT    ArP1 = {-1.0, -3.0, 0.0};

 SG_POINT    ArP2 = {-1.0, -2.0, 0.0};

 SG_POINT    ArP3 = {0.0, -3.5, 0.0};

 ArcGeo.FromTreePoints(ArP1,ArP2,ArP3,false);

 sgC2DObject*  ar = sgCreateArc(ArcGeo);

 sgGetScene()->AttachObject(ar);

 ar->SetAttribute(SG_OA_COLOR,12);

 ar->SetAttribute(SG_OA_LINE_THICKNESS, 2);

 

The axis of the spiral will lie on the (2, -3, 0) and (2, 3, 0) points. As the spiral clip isn't a closed object there will be no holes. Length of a spiral step will be 4, the spiral length - 10, and the number of meridians on the one spiral step circle will be 15:

 

 SG_POINT axeP1 = {2.0, -3.0, 0.0};

 SG_POINT axeP2 = {2.0, 3.0, 0.0};

 

 sgC3DObject* spirO = (sgC3DObject*)sgKinematic::Spiral((const sgC2DObject&)(*ar),NULL,0,

                                                 axeP1,axeP2,4,10,15,false);

 

 sgGetScene()->AttachObject(spirO);

 spirO->SetAttribute(SG_OA_COLOR,85);

 

Then we'll move the obtained surface:

 

 SG_VECTOR transV1 = {0,-11.5,0};

 spirO->InitTempMatrix()->Translate(transV1);

 spirO->ApplyTempMatrix();

 spirO->DestroyTempMatrix();

 

See also:

sgKinematic::Spiral  

sgCArc   SG_ARC

sgGetScene sgCScene::AttachObject   sgCObject::SetAttribute

 

 

Illustration:

kin_sp_s