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.

Colours follow the appearances of the design. A placed body takes the appearance applied to the body, else the one applied to the nearest occurrence above it, else the one of its physical material. A face with an appearance of its own keeps it. The GLB and the STEP file carry these colours (FUSION_APPEARANCE_COLOURS). In the STEP file every colour sits on a solid or a face: a placement that an occurrence appearance colours differently from the other placements of its body is written as a shape of its own.

What the adapter does not do:

  • It reads the bodies the design stores for its current state. Nothing is recomputed from the timeline.
  • Of an appearance it reads the colour only: no textures, no transparency and no other material properties.
  • 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 per placed body. Placements of a body share one mesh; a placement that an occurrence appearance colours differently has a mesh of its own. 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_COLOURS Bodies and faces carry the colour of their appearance, with counts (info)
FUSION_APPEARANCE_NOT_READ No appearance colour was 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, the coloured placements and faces (coloured_placements of body_placements, coloured_faces), 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.1

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.1
File Size Uploaded Provenance Actions
cad3d_ir_fusion-0.1.1.tar.gz 48.4 kB Without provenance Details for cad3d_ir_fusion-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 75.7 kB

Release files / cad3d_ir_fusion-0.1.1.tar.gz

Download URL cad3d_ir_fusion-0.1.1.tar.gz
Size 48.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1ee470559c7997fdaa1fd17117b5a4865ce53e6afc936921c42916e86213a151
BLAKE2b-256 checksum
How to use checksums
1123974220976b09d7bfee375e3247e2392b472d0f5f6c29333bae9300f0570d
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.1-py3-none-any.whl

Download URL cad3d_ir_fusion-0.1.1-py3-none-any.whl
Size 27.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9302b402a197c1752811c83735be473c4706748f55d07871c79289430fcfcd8d
BLAKE2b-256 checksum
How to use checksums
a40412ae3dbc354dfc55143c7294c54a99228ccf39f358468cb3ebc77fe5987a
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.1

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