addam / Export-Paper-Model-from-Blender

Python addon for creating paper models in Blender (development version)
https://blenderartists.org/t/export-paper-model/476597
406 stars 54 forks source link

Exception while exporting #34

Closed x2b closed 7 years ago

x2b commented 9 years ago

Hey there,

not sure if this is still maintained, but anyways... I am seeing the following exception while exporting a model:

Traceback (most recent call last):
  File "/home/asdasdasd/.config/blender/2.73/scripts/addons/io_export_paper_model.py", line 1837, in invoke
    self.unfolder.prepare(cage_size, create_uvmap=self.do_create_uvmap, scale=sce.unit_settings.scale_length/self.scale)
  File "/home/asdasdasd/.config/blender/2.73/scripts/addons/io_export_paper_model.py", line 160, in prepare
    self.mesh.generate_cuts(cage_size / scale if cage_size else None, priority_effect)
  File "/home/asdasdasd/.config/blender/2.73/scripts/addons/io_export_paper_model.py", line 284, in generate_cuts
    if island_a.join(island_b, edge, size_limit=page_size):
  File "/home/asdasdasd/.config/blender/2.73/scripts/addons/io_export_paper_model.py", line 1003, in join
    segments.sort(key=slope_from(position))
  File "/home/asdasdasd/.config/blender/2.73/scripts/addons/io_export_paper_model.py", line 904, in slope
    return (vec.y / vec.length + 1) if ((vec.x, vec.y) > (0, 0)) else (-1 - vec.y / vec.length)
ZeroDivisionError: float division by zero

If you want me to provide you with the file, please tell me.

addam commented 9 years ago

I believe the file will not be necessary this time, the last two lines tell quite everything. Please, check if I fixed the script correctly.

x2b commented 9 years ago

Well, we are one step further apparently :)

Traceback (most recent call last):
  File "/home/asdasdasd/.config/blender/2.73/scripts/addons/io_export_paper_model.py", line 1813, in execute
    self.unfolder.save(self.properties)
  File "/home/asdasdasd/.config/blender/2.73/scripts/addons/io_export_paper_model.py", line 195, in save
    self.mesh.generate_stickers(properties.sticker_width, properties.do_create_numbers)
  File "/home/asdasdasd/.config/blender/2.73/scripts/addons/io_export_paper_model.py", line 388, in generate_stickers
    target_island.add_marker(Arrow(uvedge_a, default_width, index))
  File "/home/asdasdasd/.config/blender/2.73/scripts/addons/io_export_paper_model.py", line 1233, in __init__
    sin, cos = edge.y / edge.length, edge.x / edge.length
ZeroDivisionError: float division by zero

Edit: The mesh is not even messed up, but the mirror modifier seems to do some strange things...

addam commented 9 years ago

Sorry for the delay. This time I'm not sure what exactly is going on, but it should not matter much. I changed something. Does the export finally work?

addam commented 7 years ago

Long time no see. I believe the bug has been fixed, and therefore I close this issue.