Cylinder

This class represents the concept Cylinder.

Class

class GeometricItem
   relation material
      range Material, cardinality [0, 1]
class Solid
class Cylinder
   property length
      range double (64 bit), cardinality [1, 1]
   property radius
      range double (64 bit), cardinality [1, 1]
   property segmentationParts
      range integer (64 bit), cardinality [0, 1]    

Example

Here you can find code snippits that show how the API call Cylinder can be used.

#include "engine/include/engine.h"

int64_t model = CreateModel();

if (model) {
    //
    //  Classes
    //
    int64_t classCylinder = GetClassByName(model, "Cylinder");

    //
    //  Datatype Properties (attributes)
    //
    int64_t propertyLength = GetPropertyByName(model, "length"),
            propertyRadius = GetPropertyByName(model, "radius"),
            propertySegmentationParts = GetPropertyByName(model, "segmentationParts");

    //
    //  Instances (creating)
    //
    int64_t myInstanceCylinder = CreateInstance(classCylinder, nullptr);

    double  length = 1.8,
            radius = 1.3;
    int64_t segmentationParts = 36;
        
    SetDatatypeProperty(myInstanceCylinder, propertyLength, &length, 1);
    SetDatatypeProperty(myInstanceCylinder, propertyRadius, &radius, 1);
    SetDatatypeProperty(myInstanceCylinder, propertySegmentationParts, &segmentationParts, 1);

    //
    //  The resulting model can be viewed in 3D-Editor.exe
    //
    SaveModel(model, "c:\\created\\myCylinder.bin");
    CloseModel(model);
}