Skip to content

feature: Add flag to optionally turn cylinder primitive into pipe - #35

Merged
EliCDavis merged 1 commit into
EliCDavis:mainfrom
alexykot:feature/cylinder-pipe
Jul 10, 2024
Merged

feature: Add flag to optionally turn cylinder primitive into pipe#35
EliCDavis merged 1 commit into
EliCDavis:mainfrom
alexykot:feature/cylinder-pipe

Conversation

@alexykot

@alexykot alexykot commented Jul 9, 2024

Copy link
Copy Markdown
Contributor

I needed to make a cylinder with one side open, optimizing for minimal triangles in this mesh, as I have a lot of copies of it in my resulting model. So I've added flags into the primitives.Cylinder to optionally not generate top and/or bottom of the cylinder and skip those triangles.

Flags are set to positive by default, so preserve current behavior of the existing code.

I didn't try to optimise local allocations to not create the corresponding meshes at all. This only prevents including them into resulting mesh. I can do that easily if it's worth it.

@alexykot

alexykot commented Jul 9, 2024

Copy link
Copy Markdown
Contributor Author

I thought of adding another dedicated Pipe primitive, but they will be nearly identical, so a flag seems more fitting.

@EliCDavis

Copy link
Copy Markdown
Owner

Looks good to me!

@EliCDavis
EliCDavis merged commit 3e694d9 into EliCDavis:main Jul 10, 2024
@alexykot
alexykot deleted the feature/cylinder-pipe branch July 10, 2024 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants