Skip to content
Discussion options

You must be logged in to vote

assy.export() doesn't take a unit option for glTF. exportGLTF hands the tessellated doc straight to OCCT's RWGltf_CafWriter with your mm values as-is (assembly.py). The writer can convert though, you just have to tell its coordinate converter what unit the input is in. Copy of exportGLTF with one extra line:

from cadquery.occ_impl.exporters.assembly import toCAF
from cadquery.occ_impl.geom import Location
from OCP.RWGltf import RWGltf_CafWriter
from OCP.TCollection import TCollection_AsciiString
from OCP.TColStd import TColStd_IndexedDataMapOfStringString
from OCP.Message import Message_ProgressRange

def export_gltf_mm(assy, path, tolerance=1e-3, angular_tolerance=0.1):
    binary = not p…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ghsoares
Comment options

Answer selected by ghsoares
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants