Adds support for the extrusion capability to the CadDocument class.#804
Adds support for the extrusion capability to the CadDocument class.#804trungleduc merged 4 commits intojupytercad:mainfrom
extrusion capability to the CadDocument class.#804Conversation
|
Integration tests report: appsharing.space |
|
Preview PR at appsharing.space |
| self.set_visible(shape2, False) | ||
| return self.add_object(OBJECT_FACTORY.create_object(data, self)) | ||
|
|
||
| def extrude( |
|
|
||
| def extrude( | ||
| self, | ||
| name: str = "", |
There was a problem hiding this comment.
I don't find it ideal to have empty string for name as fallback - maybe something else like "extruded" or "extruded shape"? I admit this is the situation in other functions as well so maybe we can tackle this in a separate PR
There was a problem hiding this comment.
Good thought, I was about to tackle this in a seperate PR, but it actually looks like there is a solution already: https://github.com/search?q=repo%3Ajupytercad%2FJupyterCAD%20_new_name&type=code
| length_fwd: float = 10, | ||
| length_rev: float = 0, | ||
| solid: bool = False, | ||
| color: Optional[str] = None, |
There was a problem hiding this comment.
Although I see the correct color when you extrude in the video clip on this PR but still it'd be nicer to use "#808080" as fallback here
There was a problem hiding this comment.
Thanks good thought - there is a fallback here which Defaults to the base object's color if None (I copied this idea from one of the other methods in this class), and if I understand correctly I think every sketch object is assigned a default color:
(Apologies if I'm misunderstand this though :) )
UPDATE: I've just realised that _get_color has a fallback to use "#808080":
| def extrude( | ||
| self, | ||
| name: str = "", | ||
| shape: str | int = None, |
There was a problem hiding this comment.
What happens when you don't provide this shape arg?
There was a problem hiding this comment.
Thanks good thought, I actually copied this from one of the other methods in this class too, this line uses the _get_operand method to:
"If no objects are provided as input, the last created object will be used as operand."
|
Thanks for approving @trungleduc, sorry I can't seem to merge this, not sure if you can help with this? Many thanks again! |
|
thanks! |
Was trying to decide whether to call this method "extrude" vs "extrusion" - please feel free to rename if preferable. All other thoughts also very welcome.
extrude.mp4
Thanks!