Skip to content

Implement Basic SDF Boolean Example - #14

Merged
nixonyh merged 7 commits into
mainfrom
feature/boolean_operations
Apr 8, 2026
Merged

Implement Basic SDF Boolean Example#14
nixonyh merged 7 commits into
mainfrom
feature/boolean_operations

Conversation

@Sheerwin02

@Sheerwin02 Sheerwin02 commented Mar 23, 2026

Copy link
Copy Markdown
Contributor
image

This is the uploaded screenshot.

Fix #13

@Sheerwin02
Sheerwin02 requested a review from nixonyh as a code owner March 23, 2026 12:26
@Sheerwin02
Sheerwin02 marked this pull request as draft March 23, 2026 14:15

@nixonyh nixonyh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good overall! Would love to have the comments addressed. Do you have a screenshot to paste it in this PR? Thanks.

Comment thread src/sdf.rs
Comment thread src/sdf/boolean.rs Outdated
Comment thread src/sdf/boolean.rs Outdated
Comment thread src/sdf/boolean.rs Outdated
Comment thread src/sdf/boolean.rs Outdated
@Sheerwin02
Sheerwin02 requested a review from mrclputra April 6, 2026 12:55
mrclputra
mrclputra previously approved these changes Apr 7, 2026

@mrclputra mrclputra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good to me,

@nixonyh

nixonyh commented Apr 7, 2026

Copy link
Copy Markdown
Member

I think @Sheerwin02 brought up that there was some issues with intersections right?

Perhaps @Sheerwin02 you could simplify the examples to just 2 spheres for now. That would make it easier to determine what's what.


// Boolean operations for grouping primitives.
const OP_UNION: u32 = 0u;
const OP_DIFFERENCE: u32 = 1u;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
const OP_DIFFERENCE: u32 = 1u;
const OP_SUBTRACTION: u32 = 1u;

Can we rename this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think difference would be a more suitable name, in my opinion.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm. Elaborate 🤔.

Comment thread src/sdf/boolean.rs
#[derive(Debug, Clone, Copy, PartialEq, Eq, Reflect)]
pub enum BooleanOp {
Union = 0,
Difference = 1,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Difference = 1,
Subtraction = 1,

Comment thread src/main.rs
@nixonyh
nixonyh requested a review from mrclputra April 7, 2026 06:13
@nixonyh
nixonyh dismissed mrclputra’s stale review April 7, 2026 06:13

Changes needed

@nixonyh
nixonyh marked this pull request as ready for review April 8, 2026 06:06

@nixonyh nixonyh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Clean, once the screenshot is updated (to confirm the various operations work) and the checks pass, we can merge this :)

@Sheerwin02

Sheerwin02 commented Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

Clean, once the screenshot is updated (to confirm the various operations work) and the checks pass, we can merge this :)

I had updated the screenshot, you guys can verify is the output accurate.

@nixonyh

nixonyh commented Apr 8, 2026

Copy link
Copy Markdown
Member

Looks correct! Union was not in the demo, but we had verified that it works previously.

@nixonyh
nixonyh merged commit 27e943f into main Apr 8, 2026
7 checks passed
@nixonyh
nixonyh deleted the feature/boolean_operations branch April 8, 2026 07:02
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.

Boolean Operations

3 participants