Open sh-stesney opened 1 year ago
hi,
the error message is indeed not very helpful.
to work with NURBS outside of Rhino, you have to install compas_occ
...
activate your environment and do
conda install compas_occ
Thank you so much. That worked.
I need curves to make breps with the extrusion method, however testing is returning unexpected results. I was expected the two breps to have equal area and volume.
from compas.geometry import Point, Vector, Box
from compas_occ.brep import BRep
from compas_occ.geometry import OCCNurbsCurve
def test_brep():
points = [
Point(0, 0, 0),
Point(0, 10, 0),
Point(10, 10, 0),
Point(10, 0, 0),
Point(0,0,0)
]
curve = OCCNurbsCurve.from_points(points, degree=1)
vector = Vector(0, 0, 10)
brep1 = BRep.from_extrusion(curve, vector)
print(f"curve length: {curve.length()}")
print(f"brep1 - area: {brep1.area}, volume: {brep1.volume}")
box = Box.from_width_height_depth(10, 10, 10)
brep2 = BRep.from_box(box)
print(f"brep2 - area: {brep2.area}, volume: {brep2.volume}")
if __name__ == "__main__":
test_brep()
curve length: 40.0
brep1 - area: 400.0, volume: 650.804722446989
brep2 - area: 599.9999999999999, volume: 999.9999999999998
Describe the bug Compas fails to produce a Nurbs curve from points.
To Reproduce Steps to reproduce the behavior: Sample script:
Expected behavior The function should return a nurbs curve
Desktop (please complete the following information):
Additional context Compas v1.17.3