Skip to content

Add materials to assemblies #1620

Open
Open
@adrianschneider94

Description

@adrianschneider94

As far as I can see, it's only possible to add colors so far.
That could be extended to handling materials by using XCAFDoc_Material for physical properties and XCAFDoc_VisMaterial for visualization.

I implemented a first working approach:
https://github.com/sangl-spezialtransformatoren/cadquery/tree/materials

The syntax is at the moment:

part = create_some_part()
assembly = Assembly()

copper = Material(
    name="Copper",
    base_color=Color(0.955, 0.637, 0.538, 1),
    density=8.9,
    metalness=1,
    roughness=0.1,
)

assembly.add(part, material=copper)

I wanted to use this issue as a discussion entrypoint, a pull request could follow later.

Links to OCCT documentation:

Metadata

Metadata

Assignees

No one assigned

    Labels

    OCC featureRequires coding at OCC implementation levelenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions