-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHelixPointsNode.cpp
More file actions
46 lines (36 loc) · 1.05 KB
/
HelixPointsNode.cpp
File metadata and controls
46 lines (36 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* The Mailo Today Solutions Software License
*
* Copyright 2016 Mailo Today Solutions.
*
* This program is free software, distributed under the terms of the
* GNU General Public License (GPL)
* http://www.gnu.org/licenses
*/
#include "HelixPointsNode.h"
HelixPointsNode::HelixPointsNode(){
out_Points.reset(new vector<Point3D>);
}
void HelixPointsNode::evaluate(){
if(*in_NumberOfPoints > 0){
out_Points->clear();
float ratio = 1;
if(*in_ArcAngle > 0)
ratio = *in_ArcAngle/360;
for(int i=0; i <= *in_NumberOfPoints * ratio; i++){
float angle = 2.0f*(float)X_PI*i/(*in_NumberOfPoints);
float x = cos(angle)*(*in_Radius);
float y = sin(angle)*(*in_Radius);
float z = angle/(*in_Rise);
Point3D newPoint(x,y,z);
out_Points->push_back(newPoint);
/*if(axis == CIRCLE_X_AXIS){
points.push_back(Vector3(0.0f, y, x));
}else if(axis == CIRCLE_Y_AXIS){
points.push_back(Vector3(x, 0.0f, y));
}else{
points.push_back(Vector3(x, y, 0.0f));
}*/
}
}
}