Skip to content

Conversation

@asmith26
Copy link
Contributor

@asmith26 asmith26 commented Oct 15, 2025

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!

@github-actions
Copy link
Contributor

github-actions bot commented Oct 15, 2025

Integration tests report: appsharing.space

@github-actions
Copy link
Contributor

github-actions bot commented Oct 15, 2025

Preview PR at appsharing.space

Copy link
Member

@arjxn-py arjxn-py left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid work @asmith26, just have some minor comments otherwise it looks pretty good to me. Thanks :)

self.set_visible(shape2, False)
return self.add_object(OBJECT_FACTORY.create_object(data, self))

def extrude(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for the name "extrude"


def extrude(
self,
name: str = "",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

@asmith26 asmith26 Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when you don't provide this shape arg?

Copy link
Contributor Author

@asmith26 asmith26 Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

@arjxn-py arjxn-py added the enhancement New Feature or improvement label Oct 17, 2025
@asmith26 asmith26 requested a review from arjxn-py November 3, 2025 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New Feature or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants