Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NurbsCurve compas.plugins.PluginNotInstalledError #1102

Open
sh-stesney opened this issue Nov 15, 2022 · 2 comments
Open

NurbsCurve compas.plugins.PluginNotInstalledError #1102

sh-stesney opened this issue Nov 15, 2022 · 2 comments

Comments

@sh-stesney
Copy link

Describe the bug
Compas fails to produce a Nurbs curve from points.

Traceback (most recent call last):
  File "c:\Users\sh_st\Code_local\ibs\ibs_core\nurbs_curve_test.py", line 12, in <module>
    test_nurbs_curve()
  File "c:\Users\sh_st\Code_local\ibs\ibs_core\nurbs_curve_test.py", line 9, in test_nurbs_curve
    curve = NurbsCurve.from_points([Point(0, 0, 0), Point(3, 6, 0), Point(6, -3, 3), Point(10, 0, 0)])
  File "C:\Users\sh_st\anaconda3\envs\ibsenv\lib\site-packages\compas\geometry\curves\nurbs.py", line 267, in from_points
    return new_nurbscurve_from_points(cls, points, degree=degree)
  File "C:\Users\sh_st\anaconda3\envs\ibsenv\lib\site-packages\compas\plugins.py", line 302, in wrapper
    plugin_impl = _select_plugin(extension_point_url)
  File "C:\Users\sh_st\anaconda3\envs\ibsenv\lib\site-packages\compas\plugins.py", line 486, in select_plugin
    raise PluginNotInstalledError("Plugin not found for extension point URL: {}".format(extension_point_url))
compas.plugins.PluginNotInstalledError: Plugin not found for extension point URL: https:/plugins.compas.dev/factories/new_nurbscurve_from_points

To Reproduce
Steps to reproduce the behavior:
Sample script:

from compas.geometry import Point, NurbsCurve

def test_nurbs_curve():

    curve = NurbsCurve.from_points([Point(0, 0, 0), Point(3, 6, 0), Point(6, -3, 3), Point(10, 0, 0)])

if __name__ == "__main__":
    test_nurbs_curve()

Expected behavior
The function should return a nurbs curve

Desktop (please complete the following information):

  • OS: Windows 11 Pro version 21H2
  • Python version: 3.10
  • Python package manager: conda

Additional context
Compas v1.17.3

@tomvanmele
Copy link
Member

tomvanmele commented Nov 15, 2022

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

@sh-stesney
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants