cadquery icon indicating copy to clipboard operation
cadquery copied to clipboard

Add STL to Assemblys export formats

Open qwelyt opened this issue 3 years ago • 5 comments

Turn the assembly into a compound and use Shapes export method to export the assembly. This way the export function does not need to be duplicated, and it is what users have been doing manually to get their objects.

Should solve https://github.com/CadQuery/cadquery/issues/965

qwelyt avatar Jun 08 '22 20:06 qwelyt

Codecov Report

Merging #1101 (304aaea) into master (8ddad3b) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1101   +/-   ##
=======================================
  Coverage   94.01%   94.01%           
=======================================
  Files          26       26           
  Lines        5410     5412    +2     
  Branches      918      919    +1     
=======================================
+ Hits         5086     5088    +2     
  Misses        193      193           
  Partials      131      131           
Impacted Files Coverage Δ
cadquery/assembly.py 96.56% <100.00%> (+0.02%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Jun 08 '22 20:06 codecov[bot]

Shouldn't all of the "shape-formats" be supported then (and not just STL)? This situation is very similar to what is happening with Workplanes in exporters.export, where any Workplane gets converted to a compound first. You could achieve similar functionality to your proposal by allowing Assemblies in exporters.export - although I'm not in a position to foresee all issues that that could entail.

SDI8 avatar Jun 15 '22 07:06 SDI8

@lorenzncode @adam-urbanczyk Any thoughts on this?

jmwright avatar Jul 11 '22 21:07 jmwright

STL has been discussed already. It does not support all the features of assy (color), but OK popular request and whatnot. -1 for other formats though.

adam-urbanczyk avatar Jul 12 '22 15:07 adam-urbanczyk

I wasn't sure if the discussion in #965 had concluded. Regarding the use of such an STL, it may be that the user wants to access the solver functionality for a particular part. A user on Discord mentioned this approach, and asked "Am I misusing Assembly?".

lorenzncode avatar Jul 13 '22 02:07 lorenzncode

Should I merge @jmwright @lorenzncode ?

adam-urbanczyk avatar Oct 25 '22 05:10 adam-urbanczyk

+1

jmwright avatar Oct 25 '22 10:10 jmwright

+1

lorenzncode avatar Oct 25 '22 23:10 lorenzncode

Thanks @qwelyt !

adam-urbanczyk avatar Oct 26 '22 04:10 adam-urbanczyk