[CG Pipeline] баг при работе с файлом FreeCAD asm4 tower.FCStd #50

Closed
opened 2023-03-06 19:27:19 +03:00 by brothermechanic · 4 comments
brothermechanic commented 2023-03-06 19:27:19 +03:00 (Migrated from gitlab.com)

Найти и исправить баг при работе с файлом FreeCAD asm4 tower.FCStd

Error: Python: Traceback (most recent call last):
  File "/media/disk/robossembler/io-import-fcstd/test/import_test1.blend/importer.py", line 310, in <module>
    import_fcstd()
  File "/media/disk/robossembler/io-import-fcstd/test/import_test1.blend/importer.py", line 163, in import_fcstd
    v1 = ov[0].Point.sub(c)
IndexError: list index out of range
Найти и исправить баг при работе с файлом FreeCAD asm4 tower.FCStd ```python Error: Python: Traceback (most recent call last): File "/media/disk/robossembler/io-import-fcstd/test/import_test1.blend/importer.py", line 310, in <module> import_fcstd() File "/media/disk/robossembler/io-import-fcstd/test/import_test1.blend/importer.py", line 163, in import_fcstd v1 = ov[0].Point.sub(c) IndexError: list index out of range ```
brothermechanic commented 2023-03-06 19:27:20 +03:00 (Migrated from gitlab.com)

assigned to @brothermechanic

assigned to @brothermechanic
brothermechanic commented 2023-03-10 11:37:39 +03:00 (Migrated from gitlab.com)

Баг проявляется при импорте объекта без геометрии, например пивота (объекта точки координат)

Думаю что нужно добавить не просто проверку на тип объекта, а более глубокую - проверку на твердотельность

import FreeCAD

def is_object_solid(obj):
    if not isinstance(obj, FreeCAD.DocumentObject):
        return False

    if not hasattr(obj, 'Shape'):
        return False

    if not hasattr(obj.Shape, 'Solids'):
        return False

    if len(obj.Shape.Solids) == 0:
        return False

    return True
Баг проявляется при импорте объекта без геометрии, например пивота (объекта точки координат) Думаю что нужно добавить не просто проверку на тип объекта, а более глубокую - проверку на твердотельность ```python import FreeCAD def is_object_solid(obj): if not isinstance(obj, FreeCAD.DocumentObject): return False if not hasattr(obj, 'Shape'): return False if not hasattr(obj.Shape, 'Solids'): return False if len(obj.Shape.Solids) == 0: return False return True ```
brothermechanic commented 2023-03-10 18:41:39 +03:00 (Migrated from gitlab.com)

created branch 50-deselect-nonsolids to address this issue

created branch [`50-deselect-nonsolids`](/robossembler/framework/-/compare/master...50-deselect-nonsolids) to address this issue
brothermechanic commented 2023-03-10 18:42:19 +03:00 (Migrated from gitlab.com)

mentioned in merge request !21

mentioned in merge request !21
movefasta (Migrated from gitlab.com) closed this issue 2023-03-12 22:31:48 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: robossembler/framework#50
No description provided.