-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support to define parts using 3MF
- Loading branch information
Showing
9 changed files
with
61 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
desc: PartCAD example project to demonstrate parts implemented using 3MF files | ||
parts: | ||
cube: | ||
type: 3mf | ||
desc: A cube defined in 3MF | ||
render: | ||
png: | ||
prefix: ./ | ||
width: 128 | ||
height: 128 | ||
markdown: README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# OpenVMP, 2024 | ||
# | ||
# Author: Roman Kuzmenko | ||
# Created: 2024-01-06 | ||
# | ||
# Licensed under Apache License, Version 2.0. | ||
# | ||
|
||
import build123d as b3d | ||
from . import part_factory as pf | ||
from . import part as p | ||
|
||
|
||
class PartFactory3mf(pf.PartFactory): | ||
def __init__(self, ctx, project, part_config): | ||
super().__init__(ctx, project, part_config, extension=".3mf") | ||
# Complement the config object here if necessary | ||
self._create(part_config) | ||
|
||
def instantiate(self, part): | ||
shape = b3d.Mesher().read(part.path)[0].wrapped | ||
part.set_shape(shape) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters