#pragma once #include #include typedef enum { // PRIMITIVE_TYPE_CONSTANT, // PRIMITIVE_TYPE_PLANE, PRIMITIVE_TYPE_SPHERE, PRIMITIVE_TYPE_CYLINDER, PRIMITIVE_TYPE_CONE, PRIMITIVE_TYPE_BOX, PRIMITIVE_TYPE_EXTRUDE, // PRIMITIVE_TYPE_MESH, // PRIMITIVE_TYPE_EXTRUDE_POLYLINE, // PRIMITIVE_TYPE_EXTRUDE_HELIXLINE, PRIMITIVE_TYPE_MAX_COUNT } primitive_type; typedef enum { AXIS_TYPE_EXTRUDE_POLYLINE, AXIS_TYPE_EXTRUDE_HELIXLINE, AXIS_TYPE_MAX_COUNT } axis_type; typedef enum { PATTERN_TYPE_POLYLINE, PATTERN_TYPE_MAX_COUNT } pattern_type; // point[0, 1, 2] must not be on the same line! // iff point_number = 2, then the polyline will be seen as CCW typedef struct { uint32_t point_number; // The point number of the polyline vector3d* points; // The points of the polyline uint32_t bulge_number; // The bulge number of the polyline double* bulges; // The bulge of each edge vector3d reference_normal; // The reference normal of the polyline } polyline_axis_descriptor_t; typedef struct { vector3d axis_start; // The start point of the helix line vector3d axis_end; // The end point of the helix line double radius; // The radius of the helix line double advance_per_round; // he advance per round of the helix line vector3d start_direction; // The direction from axisStart to start of the helix line bool is_righthanded; // {axis_start -> axis_end} as upward direction } helixline_axis_descriptor_t; // point[0, 1, 2] must not be on the same line! typedef struct { uint32_t point_number; // The point number of the polyline vector2d* points; // The points of the polyline uint32_t bulge_number; // The bulge number of the polyline double* bulges; // The bulge of each edge vector2d anchor; // the anchor point of the polyline, used as the origin of the axis } polyline_pattern_descriptor_t; // // Note : In profiles, The first polyline is outer boundary, and the ohters is internal holes // typedef struct { // uint32_t profile_number; // The profiles number of the extruded solid // polyline_descriptor_t* profiles; // The profiles of the extruded solid // polyline_descriptor_t axis; // The axis of the extruded solid // } extrude_polyline_descriptor_t; // typedef struct { // uint32_t profile_number; // The profiles number of the extruded solid // polyline_descriptor_t* profiles; // The profiles of the extruded solid // helixline_descriptor_t axis; // The axis of the extruded solid // } extrude_helixline_descriptor_t;