Skip to content

workaround for incorrect ray intersections with open cones#140

Closed
plexoos wants to merge 1 commit into
mainfrom
workaround-for-open-cones
Closed

workaround for incorrect ray intersections with open cones#140
plexoos wants to merge 1 commit into
mainfrom
workaround-for-open-cones

Conversation

@plexoos

@plexoos plexoos commented Jul 30, 2025

Copy link
Copy Markdown
Member

No description provided.

@github-actions github-actions Bot 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.

Cpp-linter Review

Used clang-format v16.0.6

Click here for the full clang-format patch
diff --git a/CSG/csg_intersect_leaf_newcone.h b/CSG/csg_intersect_leaf_newcone.h
index 740ac5a..9801725 100644
--- a/CSG/csg_intersect_leaf_newcone.h
+++ b/CSG/csg_intersect_leaf_newcone.h
@@ -101,2 +101,2 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-    const float t_cand = fminf(roots) ; 
-    
+    const float t_cand = fminf(roots) ;
+
@@ -104 +104 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-    float3 n = normalize(make_float3(intersection_point.x, intersection_point.y, (z0 - intersection_point.z)*tth2));
+    float3 n = normalize(make_float3(intersection_point.x, intersection_point.y, (z0 - intersection_point.z) * tth2));
@@ -111,2 +110,0 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-
-

Have any feedback or feature suggestions? Share it here.

Comment thread CSG/csg_intersect_leaf_newcone.h
Comment thread CSG/csg_intersect_leaf_newcone.h Outdated
Comment thread CSG/csg_intersect_leaf_newcone.h
@plexoos plexoos force-pushed the workaround-for-open-cones branch from d561f7b to 628d53b Compare August 18, 2025 23:55
@plexoos plexoos force-pushed the workaround-for-open-cones branch from 628d53b to b26739f Compare September 3, 2025 14:56
@github-actions github-actions Bot dismissed their stale review September 3, 2025 14:57

outdated suggestion

@github-actions github-actions Bot 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.

Cpp-linter Review

Used clang-format v18.1.3

Click here for the full clang-format patch
diff --git a/CSG/csg_intersect_leaf_newcone.h b/CSG/csg_intersect_leaf_newcone.h
index 740ac5a..9801725 100644
--- a/CSG/csg_intersect_leaf_newcone.h
+++ b/CSG/csg_intersect_leaf_newcone.h
@@ -101,2 +101,2 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-    const float t_cand = fminf(roots) ; 
-    
+    const float t_cand = fminf(roots) ;
+
@@ -104 +104 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-    float3 n = normalize(make_float3(intersection_point.x, intersection_point.y, (z0 - intersection_point.z)*tth2));
+    float3 n = normalize(make_float3(intersection_point.x, intersection_point.y, (z0 - intersection_point.z) * tth2));
@@ -111,2 +110,0 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-
-

Have any feedback or feature suggestions? Share it here.

Comment thread CSG/csg_intersect_leaf_newcone.h
Comment thread CSG/csg_intersect_leaf_newcone.h Outdated
Comment thread CSG/csg_intersect_leaf_newcone.h
@github-actions github-actions Bot dismissed their stale review September 3, 2025 15:01

outdated suggestion

@github-actions github-actions Bot 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.

Cpp-linter Review

Used clang-format v18.1.3

Click here for the full clang-format patch
diff --git a/CSG/csg_intersect_leaf_newcone.h b/CSG/csg_intersect_leaf_newcone.h
index 2967d49..3bc042d 100644
--- a/CSG/csg_intersect_leaf_newcone.h
+++ b/CSG/csg_intersect_leaf_newcone.h
@@ -101 +101 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-    const float t_cand = fminf(roots) ;
+    const float t_cand = fminf(roots);
@@ -111,2 +110,0 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-
-

Have any feedback or feature suggestions? Share it here.

Comment thread CSG/csg_intersect_leaf_newcone.h Outdated
Comment thread CSG/csg_intersect_leaf_newcone.h
@plexoos plexoos force-pushed the workaround-for-open-cones branch from 77c33d5 to 5cb7458 Compare October 13, 2025 17:09
@github-actions github-actions Bot dismissed their stale review October 13, 2025 17:10

outdated suggestion

@github-actions github-actions Bot 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.

Cpp-linter Review

Used clang-format v18.1.3

Click here for the full clang-format patch
diff --git a/CSG/csg_intersect_leaf_newcone.h b/CSG/csg_intersect_leaf_newcone.h
index 2967d49..3bc042d 100644
--- a/CSG/csg_intersect_leaf_newcone.h
+++ b/CSG/csg_intersect_leaf_newcone.h
@@ -101 +101 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-    const float t_cand = fminf(roots) ;
+    const float t_cand = fminf(roots);
@@ -111,2 +110,0 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-
-

Have any feedback or feature suggestions? Share it here.

Comment thread CSG/csg_intersect_leaf_newcone.h Outdated
Comment thread CSG/csg_intersect_leaf_newcone.h
Copilot AI review requested due to automatic review settings December 5, 2025 20:26
@plexoos plexoos force-pushed the workaround-for-open-cones branch from 5cb7458 to 94857f9 Compare December 5, 2025 20:26
@github-actions github-actions Bot dismissed their stale review December 5, 2025 20:27

outdated suggestion

@github-actions github-actions Bot 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.

Cpp-linter Review

Used clang-format v18.1.3

Click here for the full clang-format patch
diff --git a/CSG/csg_intersect_leaf_newcone.h b/CSG/csg_intersect_leaf_newcone.h
index 2967d49..3bc042d 100644
--- a/CSG/csg_intersect_leaf_newcone.h
+++ b/CSG/csg_intersect_leaf_newcone.h
@@ -101 +101 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-    const float t_cand = fminf(roots) ;
+    const float t_cand = fminf(roots);
@@ -111,2 +110,0 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-
-

Have any feedback or feature suggestions? Share it here.

Comment thread CSG/csg_intersect_leaf_newcone.h Outdated
Comment thread CSG/csg_intersect_leaf_newcone.h

Copilot AI 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.

Pull request overview

This pull request attempts to fix incorrect ray intersections with open cones by simplifying the intersection logic. However, the implementation introduces several critical bugs that will cause incorrect rendering behavior.

Key changes:

  • Removed validation logic that checks if t_cand represents a valid intersection
  • Eliminated cap-specific normal calculations (normals for end cap intersections)
  • Simplified to always compute cone surface normals regardless of intersection type

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CSG/csg_intersect_leaf_newcone.h Outdated
Comment thread CSG/csg_intersect_leaf_newcone.h Outdated
Comment thread CSG/csg_intersect_leaf_newcone.h Outdated
@plexoos

plexoos commented Dec 8, 2025

Copy link
Copy Markdown
Member Author

@ggalgoczi Are you going to run this workaround by Simon?

@ggalgoczi

Copy link
Copy Markdown
Contributor

Will ask him about it later on, after finished with the photon leakage. However this is a special case of a cone in question here. I think for now we should not merge since it opens up even closed cones.

@plexoos plexoos force-pushed the workaround-for-open-cones branch from 94857f9 to 1ec9ad7 Compare December 18, 2025 16:19
@github-actions

github-actions Bot commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v20.1.2) reports: 1 file(s) not formatted
  • CSG/csg_intersect_leaf_newcone.h

Have any feedback or feature suggestions? Share it here.

@github-actions github-actions Bot dismissed their stale review December 18, 2025 16:19

outdated suggestion

@github-actions github-actions Bot 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.

Cpp-linter Review

Used clang-format v18.1.3

Click here for the full clang-format patch
diff --git a/CSG/csg_intersect_leaf_newcone.h b/CSG/csg_intersect_leaf_newcone.h
index 371c713..a4e7aa3 100644
--- a/CSG/csg_intersect_leaf_newcone.h
+++ b/CSG/csg_intersect_leaf_newcone.h
@@ -101,2 +101,2 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-    const float t_cand = fminf(roots) ; 
-    
+    const float t_cand = fminf(roots) ;
+
@@ -107 +107,2 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-        float3 n = normalize(make_float3(intersection_point.x, intersection_point.y, (z0 - intersection_point.z)*tth2));
+        float3 n =
+            normalize(make_float3(intersection_point.x, intersection_point.y, (z0 - intersection_point.z) * tth2));

Have any feedback or feature suggestions? Share it here.

Comment thread CSG/csg_intersect_leaf_newcone.h
Comment thread CSG/csg_intersect_leaf_newcone.h
@plexoos plexoos added this to simphony Mar 13, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in simphony Mar 13, 2026
@plexoos plexoos force-pushed the workaround-for-open-cones branch from 1ec9ad7 to d571830 Compare April 14, 2026 16:20
@github-actions github-actions Bot dismissed their stale review April 14, 2026 16:21

outdated suggestion

@github-actions github-actions Bot 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.

Cpp-linter Review

Used clang-format v20.1.2

Click here for the full clang-format patch
diff --git a/CSG/csg_intersect_leaf_newcone.h b/CSG/csg_intersect_leaf_newcone.h
index 371c713..a4e7aa3 100644
--- a/CSG/csg_intersect_leaf_newcone.h
+++ b/CSG/csg_intersect_leaf_newcone.h
@@ -101,2 +101,2 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-    const float t_cand = fminf(roots) ; 
-    
+    const float t_cand = fminf(roots) ;
+
@@ -107 +107,2 @@ void intersect_leaf_newcone( bool& valid_isect, float4& isect, const quad& q0, c
-        float3 n = normalize(make_float3(intersection_point.x, intersection_point.y, (z0 - intersection_point.z)*tth2));
+        float3 n =
+            normalize(make_float3(intersection_point.x, intersection_point.y, (z0 - intersection_point.z) * tth2));

Have any feedback or feature suggestions? Share it here.

Comment thread CSG/csg_intersect_leaf_newcone.h
Comment thread CSG/csg_intersect_leaf_newcone.h
@plexoos

plexoos commented Apr 14, 2026

Copy link
Copy Markdown
Member Author

I think we used this trick to run performance tests on the pfRICH geometry. If the issue with open cones is still relevant, we need to come up with a more robust solution.

@plexoos plexoos closed this Apr 14, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in simphony Apr 14, 2026
@plexoos plexoos deleted the workaround-for-open-cones branch April 14, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants