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

<class 'AttributeError'>: 'rhino3dm._rhino3dm.PolylineCurve' object has no attribute 'Radius' #6

Open
s-light opened this issue Apr 14, 2022 · 4 comments

Comments

@s-light
Copy link
Contributor

s-light commented Apr 14, 2022

if i try to import attached example file i get this error message:

<class 'AttributeError'>: 'rhino3dm._rhino3dm.PolylineCurve' object has no attribute 'Radius'

steps to reproduce

  • open FreeCAD
  • create new document (Ctrl + N)
  • import file (Ctrl + I)
  • look at console log

expected result

  • imported model of cube and ball

full console log

$ freecad
FreeCAD 0.19, Libs: 0.19R
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2021
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

connect failed: No such file or directory
Import 3DM file : /home/stefan/mydata/freecad/tests/STEP_import/BallAndCubeRH7.3dm
Import3DM Version 0.01
-----------------
Extrusion
Geometry type
<class 'rhino3dm._rhino3dm.Extrusion'>
Extrusion
['AddInnerProfile', 'CapCount', 'Create', 'CreateBoxExtrusion', 'CreateCylinderExtrusion', 'CreatePipeExtrusion', 'Decode', 'Degree', 'Domain', 'Duplicate', 'Encode', 'FrameAt', 'GetBoundingBox', 'GetMesh', 'GetNurbsFormParameterFromSurfaceParameter', 'GetPathPlane', 'GetProfilePlane', 'GetProfileTransformation', 'GetSpanVector', 'GetSurfaceParameterFromNurbsFormParameter', 'GetUserString', 'GetUserStrings', 'HasBrepForm', 'IsAtSeam', 'IsAtSingularity', 'IsCappedAtBottom', 'IsCappedAtTop', 'IsClosed', 'IsCone', 'IsCylinder', 'IsDeformable', 'IsMiteredAtEnd', 'IsMiteredAtStart', 'IsPeriodic', 'IsPlanar', 'IsSingular', 'IsSolid', 'IsSphere', 'IsTorus', 'IsValid', 'IsoCurve', 'MakeDeformable', 'MiterPlaneNormalAtEnd', 'MiterPlaneNormalAtStart', 'NormalAt', 'ObjectType', 'PathEnd', 'PathLineCurve', 'PathStart', 'PathTangent', 'PointAt', 'Profile3d', 'ProfileCount', 'ProfileIndex', 'RdkXml', 'Rotate', 'Scale', 'SetDomain', 'SetOuterProfile', 'SetPathAndUp', 'SetUserString', 'SpanCount', 'ToBrep', 'ToNurbsSurface', 'Transform', 'Translate', 'UserStringCount', 'WallEdge', 'WallSurface', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
Is Cylinder : False
<bound method PyCapsule.NormalAt of <rhino3dm._rhino3dm.Extrusion object at 0x7f81a8366cb0>>
0.0,15.000000000000002,0.0
0.0,15.000000000000002,12.0
0.0,0.0,1.0
<bound method PyCapsule.PointAt of <rhino3dm._rhino3dm.Extrusion object at 0x7f81a8366cb0>>
<bound method PyCapsule.GetPathPlane of <rhino3dm._rhino3dm.Extrusion object at 0x7f81a8366cb0>>
Profile Count : 1
0
<rhino3dm._rhino3dm.PolylineCurve object at 0x7f81c05977f0>
False
3
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/stefan/.FreeCAD/Mod/ImportNURBS/freecad/importNURBS/import3DM.py", line 36, in insert
    process3DM(doc,filename)
  File "/home/stefan/.FreeCAD/Mod/ImportNURBS/freecad/importNURBS/import3DM.py", line 405, in process3DM
    fi.parse_objects(doc)
  File "/home/stefan/.FreeCAD/Mod/ImportNURBS/freecad/importNURBS/import3DM.py", line 58, in parse_objects
    obj = self.import_geometry(doc, self.f3dm.Objects[i].Geometry)
  File "/home/stefan/.FreeCAD/Mod/ImportNURBS/freecad/importNURBS/import3DM.py", line 231, in import_geometry
    print(c.Radius)
<class 'AttributeError'>: 'rhino3dm._rhino3dm.PolylineCurve' object has no attribute 'Radius'

the same happens with the current daily build:

$ freecad-daily 
FreeCAD 0.20, Libs: 0.20R
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2022
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Sheet Metal workbench loaded
Assembly4 workbench (v0.11.10) loaded
Interlocking laser cut workbench loaded
('Mod/Pyramids_and_polyhedrons', 'Mod/Pyramids-and-Polyhedrons', 'Mod/FreeCAD-Pyramids-and-Polyhedrons', 'Mod/Pyramids-and-polyhedrons')
Cannot find icon: /Resources/icons/Maker_workbench_icon.svg
connect failed: No such file or directory
Import 3DM file : /home/stefan/mydata/freecad/tests/STEP_import/BallAndCubeRH7.3dm
Import3DM Version 0.01
-----------------
Extrusion
Geometry type
<class 'rhino3dm._rhino3dm.Extrusion'>
Extrusion
['AddInnerProfile', 'CapCount', 'Create', 'CreateBoxExtrusion', 'CreateCylinderExtrusion', 'CreatePipeExtrusion', 'Decode', 'Degree', 'Domain', 'Duplicate', 'Encode', 'FrameAt', 'GetBoundingBox', 'GetMesh', 'GetNurbsFormParameterFromSurfaceParameter', 'GetPathPlane', 'GetProfilePlane', 'GetProfileTransformation', 'GetSpanVector', 'GetSurfaceParameterFromNurbsFormParameter', 'GetUserString', 'GetUserStrings', 'HasBrepForm', 'IsAtSeam', 'IsAtSingularity', 'IsCappedAtBottom', 'IsCappedAtTop', 'IsClosed', 'IsCone', 'IsCylinder', 'IsDeformable', 'IsMiteredAtEnd', 'IsMiteredAtStart', 'IsPeriodic', 'IsPlanar', 'IsSingular', 'IsSolid', 'IsSphere', 'IsTorus', 'IsValid', 'IsoCurve', 'MakeDeformable', 'MiterPlaneNormalAtEnd', 'MiterPlaneNormalAtStart', 'NormalAt', 'ObjectType', 'PathEnd', 'PathLineCurve', 'PathStart', 'PathTangent', 'PointAt', 'Profile3d', 'ProfileCount', 'ProfileIndex', 'RdkXml', 'Rotate', 'Scale', 'SetDomain', 'SetOuterProfile', 'SetPathAndUp', 'SetUserString', 'SpanCount', 'ToBrep', 'ToNurbsSurface', 'Transform', 'Translate', 'UserStringCount', 'WallEdge', 'WallSurface', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
Is Cylinder : False
<bound method PyCapsule.NormalAt of <rhino3dm._rhino3dm.Extrusion object at 0x7f9974472d70>>
0.0,15.000000000000002,0.0
0.0,15.000000000000002,12.0
0.0,0.0,1.0
<bound method PyCapsule.PointAt of <rhino3dm._rhino3dm.Extrusion object at 0x7f9974472d70>>
<bound method PyCapsule.GetPathPlane of <rhino3dm._rhino3dm.Extrusion object at 0x7f9974472d70>>
Profile Count : 1
0
<rhino3dm._rhino3dm.PolylineCurve object at 0x7f99baa0f730>
False
3
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/stefan/mydata/freecad/config/share_FreeCAD/Mod/ImportNURBS/freecad/importNURBS/import3DM.py", line 36, in insert
    process3DM(doc,filename)
  File "/home/stefan/mydata/freecad/config/share_FreeCAD/Mod/ImportNURBS/freecad/importNURBS/import3DM.py", line 405, in process3DM
    fi.parse_objects(doc)
  File "/home/stefan/mydata/freecad/config/share_FreeCAD/Mod/ImportNURBS/freecad/importNURBS/import3DM.py", line 58, in parse_objects
    obj = self.import_geometry(doc, self.f3dm.Objects[i].Geometry)
  File "/home/stefan/mydata/freecad/config/share_FreeCAD/Mod/ImportNURBS/freecad/importNURBS/import3DM.py", line 231, in import_geometry
    print(c.Radius)
<class 'AttributeError'>: 'rhino3dm._rhino3dm.PolylineCurve' object has no attribute 'Radius'

i attached the file i tried to load.
BallAndCube.zip

@s-light
Copy link
Contributor Author

s-light commented Apr 15, 2022

fixed with #8

@KeithSloan
Copy link
Owner

As you say in #8 the Brep shape is handled but the extrusion of the PolylineCurve is NOT.

I am unsure if I should be calling ToNurbsCurve or ToPolyLine and how to test, do you have an image of object so I see what sort of line is being extruded.

@s-light
Copy link
Contributor Author

s-light commented Jun 8, 2022

thanks for looking into it!
i check tomorow if i have a image of the result...

@s-light
Copy link
Contributor Author

s-light commented Jun 10, 2022

i only have the - also included in the zip file - step BallAndCube.stp.
imported in FreeCAD it looks like this:
image

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