sk1project / uniconvertor

UniConvertor is a cross-platform universal vector graphics translator
https://sk1project.net
GNU Affero General Public License v3.0
152 stars 41 forks source link

Not able to convert CGM to SVG #25

Open Murali-mahadeva-BS opened 4 years ago

Murali-mahadeva-BS commented 4 years ago

I tried converting CGM to SVG, In logs it said loader not found for CGM file initially. Now it says this,

INFO | 12:22:40 PM | uc2.application --> Translation of "/home/murali/Downloads/uniconvertor-2.0rc4/test/corvette.cgm" into "/home/murali/Downloads/uniconvertor-2.0rc4/test/corvette.svg" INFO | 12:22:40 PM | uc2.application --> Start to search saver by file extension svg INFO | 12:22:40 PM | uc2.application --> Saver is found for extension svg INFO | 12:22:40 PM | uc2.application --> Start to search for loader by file extension cgm INFO | 12:22:40 PM | uc2.application --> Loader "cgm_loader" is found for /home/murali/Downloads/uniconvertor-2.0rc4/test/corvette.cgm INFO | 12:22:40 PM | uc2.application --> Parsing in progress... INFO | 12:22:40 PM | uc2.application --> document model is created INFO | 12:22:40 PM | uc2.application --> document model is updated successfully INFO | 12:22:40 PM | uc2.application --> document model is updated successfully INFO | 12:22:40 PM | uc2.application --> document model is destroyed for /home/murali/Downloads/uniconvertor-2.0rc4/test/corvette.cgm INFO | 12:22:40 PM | uc2.application --> document model is updated successfully ERROR | 12:22:40 PM | uc2.application --> Error while translation and saving "/home/murali/Downloads/uniconvertor-2.0rc4/test/corvette.cgm" ERROR | 12:22:40 PM | uc2.application --> Translation is interrupted 'NoneType' object is not iterable Traceback (most recent call last): File "/usr/lib/uniconvertor-2.0rc4/uc2/application.py", line 250, in run saver(doc, files[1], **options) File "/usr/lib/uniconvertor-2.0rc4/uc2/formats/svg/init.py", line 49, in svg_saver svg_doc.translate_from_sk2(sk2_doc) File "/usr/lib/uniconvertor-2.0rc4/uc2/formats/svg/svg_presenter.py", line 63, in translate_from_sk2 translator.translate(sk2_doc, self) File "/usr/lib/uniconvertor-2.0rc4/uc2/formats/svg/svg_translators.py", line 1139, in translate self.translate_page(self.svg_mt, page) File "/usr/lib/uniconvertor-2.0rc4/uc2/formats/svg/svg_translators.py", line 1168, in translate_page self.translate_objs(self.svg_mt, source_obj.childs) File "/usr/lib/uniconvertor-2.0rc4/uc2/formats/svg/svg_translators.py", line 1175, in translate_objs self.translate_layer(dest_parent, source_obj) File "/usr/lib/uniconvertor-2.0rc4/uc2/formats/svg/svg_translators.py", line 1200, in translate_layer self.translate_objs(group, source_obj.childs) File "/usr/lib/uniconvertor-2.0rc4/uc2/formats/svg/svg_translators.py", line 1193, in translate_objs self.translate_primitive(dest_parent, source_obj) File "/usr/lib/uniconvertor-2.0rc4/uc2/formats/svg/svg_translators.py", line 1252, in translate_primitive curve = source_obj.to_curve() File "/usr/lib/uniconvertor-2.0rc4/uc2/formats/sk2/sk2_model.py", line 546, in to_curve curve.update() File "/usr/lib/uniconvertor-2.0rc4/uc2/formats/sk2/sk2_model.py", line 554, in update self.cache_cpath = libgeom.create_cpath(self.cache_paths) File "/usr/lib/uniconvertor-2.0rc4/uc2/libgeom/cwrap.py", line 22, in create_cpath return libcairo.create_cpath(cache_paths) File "/usr/lib/uniconvertor-2.0rc4/uc2/libcairo/init.py", line 37, in create_cpath for path in paths: TypeError: 'NoneType' object is not iterable

It works if first converted to sk2 and then to svg. But doesnt work directly

sk1project commented 4 years ago

Hi @Murali-mahadeva-BS Could you provide a sample fle to reproduce this issue? It looks like strange object in CGM which cannot be converted into Bezier curves.

Murali-mahadeva-BS commented 4 years ago

Do you want me to submit sample files?. It works this way though. CGM to SK2 to CGM