<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Check intersection between Solid objects in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/check-intersection-between-solid-objects/m-p/7467536#M55482</link>
    <description>&lt;P&gt;Using a combination of Intersect and union gives you&amp;nbsp;a pretty good&amp;nbsp;answer.&amp;nbsp;If the solids touch at an edge&amp;nbsp;this will return [not intersecting, not touching] &amp;nbsp;instead of [touching].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;			Solid interSolid = BooleanOperationsUtils.ExecuteBooleanOperation(s1,s2, BooleanOperationsType.Intersect);
			if (Math.Abs( interSolid.Volume)&amp;gt;0.000001) 
			{
				TaskDialog.Show("debug", "intersecting");
				return;
			}
			Solid unionSolid = BooleanOperationsUtils.ExecuteBooleanOperation(s1,s2, BooleanOperationsType.Union);
			double dArea = Math.Abs(s1.SurfaceArea+s2.SurfaceArea -unionSolid.SurfaceArea);
			if (dArea&amp;lt; 0.00001 &amp;amp;&amp;amp; s1.Edges.Size+s2.Edges.Size == unionSolid.Edges.Size)
				{ TaskDialog.Show("debug","not intersecting, not touching"); }
			else{TaskDialog.Show("debug","touching");}
&lt;/PRE&gt;</description>
    <pubDate>Tue, 17 Oct 2017 14:58:29 GMT</pubDate>
    <dc:creator>FAIR59</dc:creator>
    <dc:date>2017-10-17T14:58:29Z</dc:date>
    <item>
      <title>Check intersection between Solid objects</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-intersection-between-solid-objects/m-p/7466728#M55481</link>
      <description>&lt;P&gt;I tried using&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var unionvolume = BooleanOperationsUtils.ExecuteBooleanOperation(solid1, solid2, BooleanOperationsType.Union).Volume&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&lt;SPAN&gt;solid1&lt;/SPAN&gt;.Volume &amp;lt; unionvolume)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Do something&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;but&amp;nbsp;it looks like it somehow merge those two solids even if they are miles away.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;BooleanOperationsType.Intersection/Difference doesn't work either since &lt;STRONG&gt;i need even touching solids&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;is there a solution to this problem?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Also a BoundingBox is not a solution since i may have complex shaped stuff&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 11:38:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-intersection-between-solid-objects/m-p/7466728#M55481</guid>
      <dc:creator>giancarlo.web</dc:creator>
      <dc:date>2017-10-17T11:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Check intersection between Solid objects</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-intersection-between-solid-objects/m-p/7467536#M55482</link>
      <description>&lt;P&gt;Using a combination of Intersect and union gives you&amp;nbsp;a pretty good&amp;nbsp;answer.&amp;nbsp;If the solids touch at an edge&amp;nbsp;this will return [not intersecting, not touching] &amp;nbsp;instead of [touching].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;			Solid interSolid = BooleanOperationsUtils.ExecuteBooleanOperation(s1,s2, BooleanOperationsType.Intersect);
			if (Math.Abs( interSolid.Volume)&amp;gt;0.000001) 
			{
				TaskDialog.Show("debug", "intersecting");
				return;
			}
			Solid unionSolid = BooleanOperationsUtils.ExecuteBooleanOperation(s1,s2, BooleanOperationsType.Union);
			double dArea = Math.Abs(s1.SurfaceArea+s2.SurfaceArea -unionSolid.SurfaceArea);
			if (dArea&amp;lt; 0.00001 &amp;amp;&amp;amp; s1.Edges.Size+s2.Edges.Size == unionSolid.Edges.Size)
				{ TaskDialog.Show("debug","not intersecting, not touching"); }
			else{TaskDialog.Show("debug","touching");}
&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Oct 2017 14:58:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-intersection-between-solid-objects/m-p/7467536#M55482</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2017-10-17T14:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Check intersection between Solid objects</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/check-intersection-between-solid-objects/m-p/10896432#M55483</link>
      <description>&lt;P&gt;Very great solution!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to contribue with the situation, I've created another kind of analysis based on the above method and its works very well on my workflow, I am just sharing with you below just for the sake of contribution in some way:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Solid unionSolid = BooleanOperationsUtils.ExecuteBooleanOperation(solid1, solid2, BooleanOperationsType.Union);
Solid interSolid = BooleanOperationsUtils.ExecuteBooleanOperation(solid1, solid2, BooleanOperationsType.Intersect);
double sumArea = Math.Round(Math.Abs(solid1.SurfaceArea + solid2.SurfaceArea), 5);
double sumFaces = Math.Abs(solid1.Faces.Size + solid2.Faces.Size);
double unionArea = Math.Round(Math.Abs(unionSolid.SurfaceArea), 5);
double unionFaces = Math.Abs(unionSolid.Faces.Size);

if (sumArea == unionArea &amp;amp;&amp;amp; sumFaces == unionFaces &amp;amp;&amp;amp; interSolid.Volume &amp;lt; 0.00001){TaskDialog.Show("debug", "not touching, not intersecting");
else if (sumArea &amp;gt; unionArea &amp;amp;&amp;amp; sumFaces &amp;gt; unionFaces &amp;amp;&amp;amp; interSolid.Volume &amp;gt; 0.00001)  {TaskDialog.Show("debug", "intersecting"); }
else if (sumArea &amp;gt; unionArea &amp;amp;&amp;amp; sumFaces &amp;gt; unionFaces &amp;amp;&amp;amp; interSolid.Volume &amp;lt; 0.00001) {TaskDialog.Show("debug", "touching");}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 15:04:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/check-intersection-between-solid-objects/m-p/10896432#M55483</guid>
      <dc:creator>danielpinheiro860</dc:creator>
      <dc:date>2022-01-21T15:04:32Z</dc:date>
    </item>
  </channel>
</rss>

