MCPcopy Create free account
hub / github.com/OpenWebCAD/node-occ / Edge

Class Edge

src/Edge.h:6–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include "Vertex.h"
5
6class Edge : public Base {
7
8public:
9 TopoDS_Edge m_edge;
10 std::vector<float> m_positions;
11
12 Edge() {
13 ;
14 }
15
16 bool isSeam(Base *face);
17
18 bool isDegenerated();
19 bool isClosed();
20 int numVertices();
21 double length();
22
23 v8::Local<v8::Object> polygonize(double factor);
24
25 int createLine(Vertex *start, Vertex *end);
26 int createArc(Vertex *start, Vertex *end, const gp_Pnt& center);
27 int createArc3P(Vertex *start, Vertex *end, const gp_Pnt& middlePoint);
28
29 int createCircle(const gp_Pnt& center , const gp_Dir& normal, double radius);
30
31 //int createEllipse(OCCStruct3d pnt, OCCStruct3d nor, double rMajor, double rMinor);
32 //int createHelix(double pitch, double height, double radius, double angle, bool leftHanded);
33 //int createBezier(OCCVertex *start, OCCVertex *end, std::vector<OCCStruct3d> points);
34 //int createSpline(OCCVertex *start, OCCVertex *end, std::vector<OCCStruct3d> points,double tolerance);
35 //int createNURBS(OCCVertex *start, OCCVertex *end, std::vector<OCCStruct3d> points, DVec knots, DVec weights, IVec mult);
36
37 bool canSetShape(const TopoDS_Shape& shape) const {
38 return shape.ShapeType() == TopAbs_EDGE;
39 }
40 virtual const TopoDS_Shape& shape() const {
41 return m_edge;
42 }
43 virtual const TopoDS_Edge& edge() const {
44 return m_edge;
45 }
46 virtual void setShape(const TopoDS_Shape& shape) {
47 m_edge = TopoDS::Edge(shape);
48 }
49 virtual v8::Local<v8::Object> Clone() const ;
50 virtual Base* Unwrap(v8::Local<v8::Object> obj) const {
51 return Nan::ObjectWrap::Unwrap<Edge>(obj);
52 }
53
54 static NAN_PROPERTY_GETTER(getter_firstVertex);
55 static NAN_PROPERTY_GETTER(getter_lastVertex);
56
57 // Static Methods
58 static NAN_METHOD(static_createLine);
59 static NAN_METHOD(static_createCircle);
60 static NAN_METHOD(static_createArc3P);
61
62
63 static NAN_METHOD(polygonize);

Callers 5

polygonizeMethod · 0.70
NAN_METHODFunction · 0.70
setShapeMethod · 0.70
extractEdgeFromFaceMethod · 0.70
NAN_METHODFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected