Skip to main content

cad3d-ir-fusion

cad3d-ir-fusion imports Autodesk Fusion designs (.f3d) and design packages (.f3z) into cad3d-ir through buildf3d and cq-acis. buildf3d reads the component tree and places every occurrence, with the linked designs of an F3Z expanded in place. cq-acis converts the ASM bodies of the shown components into exact OCCT solids. The adapter writes one glTF binary with the same conventions as the STEP adapter, and because the solids are exact B-Rep, the same design can be written as a STEP assembly (export_step).

A Fusion design stores lengths in centimetres; the package is in millimetres.

What the adapter does not do:

  • It reads the bodies the design stores for its current state. Nothing is recomputed from the timeline.
  • Appearances are not read; bodies use the default colour.
  • Hidden occurrences and hidden bodies are left out of the visualization (FUSION_HIDDEN). A hidden occurrence stays in the package with visible: false.
  • Bodies whose faces do not close a volume (surface bodies) are left out (FUSION_BODY_SHEET), and so is a body with geometry the converter does not build (FUSION_BODY_UNSUPPORTED, FUSION_BODY_FAILED).
  • Components of linked designs that are not in the file, as in an F3D saved without its references, are left out (FUSION_LINK_UNRESOLVED).
  • A record stored in a layout buildf3d does not read is skipped and reported (FUSION_DESIGN_PARTIAL).
  • Mesh bodies, sketches, joints and the timeline are not read.

The distribution depends on cad3d-ir, cad3d-ir-step (tessellation and the STEP writer), buildf3d and cq-acis[occt]; the core distribution does not depend on this adapter. buildf3d and cq-acis need Python 3.11 or later: on Python 3.10 the package installs without them and reading raises FusionImportError.

Usage

from pathlib import Path

from cad3d_ir import DirectoryResourceWriter
from cad3d_ir.importers import ImportOptions
from cad3d_ir_fusion import FusionImporter, export_step

result = FusionImporter().import_file(
    Path("assembly.f3z"),
    options=ImportOptions(
        strict=False, include_visualization_mesh=True, include_brep=False
    ),
    resources=DirectoryResourceWriter("converted"),
)
print(result.statistics["bodies_converted"], result.statistics["triangles"])
for item in result.diagnostics:
    print(item.code, item.message)

export_step(Path("assembly.f3z"), Path("assembly.step"), schema="AP214")
cad3d-ir-fusion assembly.f3z converted --step assembly.step

read_source returns the design and its converted bodies once, so one read can feed both map_source and export_step.

Package layout

  • One ProductDefinition per component that is placed, part, assembly or hybrid (bodies and occurrences). The root product is named after the root component, or after the file when the design was never saved.
  • One Occurrence per child of a component configuration, with the placement relative to its parent. Instances of one component share a Configuration when their children sit at the same places; a path pose that places the children of two instances differently gives each its own configuration. A hidden occurrence has visible: false and an empty configuration.
  • One Body per converted body, named as in the design, with a brep representation when include_brep is set (one OCCT BREP resource per body, in the frame of its component; approximate when stored fits stand in).
  • One package Visualization (GLB, millimetres, Z up): one glTF node per shown occurrence, nested like the occurrences, and one node and one shared mesh per body. Node extras.id names the occurrence or the body.
  • The preview image the design stores, when it has one, as a resource with properties.role == "preview-image"; metadata.preview_resource_id names it. It is written even when no body converts, so a caller can show it.
  • For an F3Z, one SourceDocument for the package and one per design in it that is placed.

Diagnostics

Code Meaning
FUSION_UNIT_CM Lengths are converted from centimetres to millimetres (info)
FUSION_EXACT_BREP Geometry is the B-Rep the design stores, converted to OCCT (info)
FUSION_APPEARANCE_NOT_READ Appearances are not read; default colour (info)
FUSION_HIDDEN Hidden occurrences and bodies are left out of the visualization (info)
FUSION_APPROXIMATED_GEOMETRY Stored B-spline fits stand in for procedural curves and surfaces (info)
FUSION_BODY_SHEET Bodies whose faces do not close a volume are left out (info)
FUSION_DESIGN_PARTIAL Part of the design is in a layout buildf3d does not read
FUSION_LINK_UNRESOLVED Components of linked designs that are not in the file are left out
FUSION_BODY_UNSUPPORTED Bodies with geometry that is not converted, with reasons
FUSION_BODY_FAILED Bodies that could not be built, with reasons
FUSION_BODY_MISSING Bodies without a readable ASM body in the file
FUSION_MESH_FAILED Bodies that could not be tessellated
FUSION_PREVIEW_ONLY No shape can be displayed; the stored preview image is available
FUSION_NO_GEOMETRY No body yielded a displayable shape (error)
FUSION_DESIGN_UNSUPPORTED The component tree could not be read (error)
FUSION_KERNEL_MISSING cq-acis's occt extra is not installed (error)
FUSION_LIMIT buildf3d stopped at a resource limit (error)
FUSION_READ_FAILED The archive could not be read (error)

statistics carries the source format (f3d or f3z), buildf3d's status of the design, counts of documents, components, shown instances and hidden occurrences, body counts by outcome (bodies_converted, bodies_open_shell, bodies_unsupported, bodies_failed, bodies_missing), the reasons by converter code, the counts of approximated curves and surfaces with the largest fit tolerance, triangle counts and the read and conversion times, so a caller can show what was and was not read.

License

MIT, like cad3d-ir, buildf3d and cq-acis. Autodesk and Fusion are trademarks of Autodesk, Inc.; this adapter reads the saved files and ships no Autodesk software.

Metadata

Release files for cad3d-ir-fusion 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cad3d-ir-fusion 0.1.0
File Size Uploaded Provenance Actions
cad3d_ir_fusion-0.1.0.tar.gz 38.8 kB Without provenance Details for cad3d_ir_fusion-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cad3d-ir-fusion 0.1.0
File Interpreter ABI Platform Actions
cad3d_ir_fusion-0.1.0-py3-none-any.whl Python 3 none any Details for cad3d_ir_fusion-0.1.0-py3-none-any.whl

Total release size: 63.0 kB

Release files / cad3d_ir_fusion-0.1.0.tar.gz

Download URL cad3d_ir_fusion-0.1.0.tar.gz
Size 38.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ab7eb4c037a2a6e2db9ad20a6780bd77579da1aef4a6e300e8e384a7273993cb
BLAKE2b-256 checksum
How to use checksums
2c3c470da7fa096ae709100a99ee1bd415a77b5755b031012cd6a5848466099a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / cad3d_ir_fusion-0.1.0-py3-none-any.whl

Download URL cad3d_ir_fusion-0.1.0-py3-none-any.whl
Size 24.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d81ca67e4a64f277ff0734d4bb5e7e77498c96d32006a9b9c69629e972d70511
BLAKE2b-256 checksum
How to use checksums
7449deddafd5862bdadd44c0c737976f5ddc27047e8242046e6d1448d04c6262
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for cad3d-ir-fusion 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page