[Solved] [CSG Import] <Exception> MultiFusion failed

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
Knochi
Posts: 10
Joined: Tue Sep 03, 2019 2:07 pm

[Solved] [CSG Import] <Exception> MultiFusion failed

Post by Knochi »

Hi,

i made a beautiful model of an SMD LED in openSCAD and wanted to use KicadStepup Workbench to convert it into a 3D model for KiCAD EDA.

Steps to reproduce:
  1. create model with freecad
  2. export as csg
  3. install FreeCad via flatpak (Discovery)
  4. open FreeCad
  5. new document
  6. open file..
  7. select .csg previously exported
Report View:

Code: Select all

12:04:18  WARNING: Token 'DOT' defined, but not used
12:04:18  WARNING: Token 'WORD' defined, but not used
12:04:18  WARNING: There are 2 unused tokens
12:04:18  <Exception> MultiFusion failed
12:04:18  Recompute failed! Please check report view.
12:04:18  <Exception> MultiFusion failed
12:04:18  Recompute failed! Please check report view.
12:04:18  <Exception> MultiFusion failed
12:04:18  <Exception> MultiFusion failed
12:04:18  Recompute failed! Please check report view.
12:04:18  <Exception> MultiFusion failed
12:04:18  <Exception> MultiFusion failed
12:04:18  Recompute failed! Please check report view.
12:04:18  <Exception> MultiFusion failed
12:04:18  <Exception> MultiFusion failed
12:04:18  Recompute failed! Please check report view.
12:04:18  <Exception> MultiFusion failed
12:04:18  <Exception> MultiFusion failed
12:04:18  Recompute failed! Please check report view.
12:04:18  <Exception> Input shape is null
12:04:18  End processing CSG file
12:04:18  <Exception> MultiFusion failed
12:04:18  <Exception> MultiFusion failed
12:04:18  Recompute failed! Please check report view.
Version Info:

Code: Select all

OS: KDE Flatpak runtime (KDE/plasma-steamos-oneshot)
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git)
Build type: Release
Branch: (HEAD detached at 0.20.1)
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.9.9, Qt 5.15.5, Coin 4.0.0, Vtk 8.2.0, OCC 7.6.2
Locale: English/Germany (en_DE)
Installed mods: 
  * kicadStepUpMod 10.16.5

The attachment SideLED_freeCADrender_221201_DNK.png is no longer available
The attachment SideLED_openSCADrender_221201_DNK.png is no longer available
I narrowed down the problem to the "cap()" module:

Code: Select all

module cap(){
    translate([-capWidth/2,0,bodyDims.z/2]) difference(){
      cube([capWidth,bodyDims.y,bodyDims.z],true);
      for (iy=[-1,1])
        translate([capWidth/2,iy*bodyDims.y/2]) circle(filRad);
      cube([capWidth+fudge,bodyDims.y-filRad*2-plating*2,bodyDims.z-plating*2],true);

      translate([-(capWidth-(capWidth-filRad-plating)+fudge)/2,0,0]) 
        cube([capWidth-filRad-plating+fudge,bodyDims.y+fudge,bodyDims.z-plating*2],true);
    }
  }
  
freeCad screenshot
freeCad screenshot
SideLED_freeCADrender_221201_DNK.png (134.5 KiB) Viewed 565 times

The issue seems to be in the for loop that gets substracted

Code: Select all

for (iy=[-1,1])
  translate([capWidth/2,iy*bodyDims.y/2]) circle(filRad);
[edit] ok seems like actually the circle is the problem. Even one circle, without the for loop, don't work.

without that it renders in FreeCad
Attachments
openSCAD screenshot
openSCAD screenshot
SideLED_openSCADrender_221201_DNK.png (228.48 KiB) Viewed 565 times
Last edited by Knochi on Thu Dec 01, 2022 12:28 pm, edited 5 times in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [CSG Import] <Exception> MultiFusion failed

Post by Kunda1 »

Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Knochi
Posts: 10
Joined: Tue Sep 03, 2019 2:07 pm

Re: [CSG Import] <Exception> MultiFusion failed

Post by Knochi »

You can close this thread... tried to substract a circle (2D) from an cube(3D) :lol:

openSCAD didn't produce a warning but when i use cylinder() instead it works.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Solved] [CSG Import] <Exception> MultiFusion failed

Post by Kunda1 »

Marked it [Solved] ;)
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
keithsloan52
Veteran
Posts: 2756
Joined: Mon Feb 27, 2012 5:31 pm

Re: [CSG Import] <Exception> MultiFusion failed

Post by keithsloan52 »

Knochi wrote: Thu Dec 01, 2022 12:10 pm You can close this thread... tried to substract a circle (2D) from an cube(3D) :lol:

openSCAD didn't produce a warning but when i use cylinder() instead it works.
So to clarify Native OpenSCAD did nor barf
did it correctly render?
Did it use a Sphere instead or a circle?
Does it do likewise for a square?
Does it also work the other way does it use a circle when subtracting a sphere from a square?

The FC OpenSCAD importer relies on having a valid CSG file.
If OpenSCAD is handling this as a special case i.e. using a Sphere for a circle when mixing 2D and 3D operations
then it would not be to hard to add this to the importer.

@chennes
Post Reply