forked from orbingol/NURBS-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfreeform.py
39 lines (30 loc) · 1.06 KB
/
freeform.py
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
"""
.. module:: freeform
:platform: Unix, Windows
:synopsis: Provides freeform geometry classes
.. moduleauthor:: Onur Rauf Bingol <orbingol@gmail.com>
"""
from geomdl import abstract
class Freeform(abstract.Geometry):
""" n-dimensional freeform geometry """
def __init__(self, **kwargs):
super(Freeform, self).__init__(**kwargs)
self._geometry_type = "freeform"
self.name = "freeform geometry"
@property
def data(self):
""" Returns a dict which contains the geometry data.
Please refer to the `wiki <https://github.com/orbingol/NURBS-Python/wiki/Using-Python-Properties>`_ for details
on using this class member.
"""
return dict(
type=self.type,
points=tuple(self.evalpts)
)
def evaluate(self, **kwargs):
""" Sets points that form the geometry.
Keyword Arguments:
* ``points``: sets the points
"""
self._eval_points = kwargs.get('points', self._init_array())
self._dimension = len(self._eval_points[0])