Regarding the Writer
I continued the dialogue about the room and wall adjacency with Massimiliano Revelli of Informatica Program srl, simply because he's truly thinking about determining the wall area adjacent towards the place, instead of just the overlapping curve section duration.
The overlapping area is naturally simple to determine in the event the wall incorporates a continuous height, as I pointed out in the earlier publish,
Office Professional Plus 2007 Key, but that is frequently not the scenario. As an example, let us take a look at the higher wall on this flooring prepare of a basic illustration demonstrating the problems, highlighted in red:
The 3D view with the highlighted wall appears similar to this:
The wall geometry and the sound it offers is not subdivided with the level in which it intersects the interior wall, as we will see through the triangles shown through the factor viewer SDK sample:
To decide the precise adjacent place,
Microsoft Office 2007 Enterprise, we want to find out the inner deal with of your wall and determine which part of it overlaps the space boundary segments. We are able to take advantage of the remedies concerning how to decide the internal encounter from the wall and its region from earlier discussions.
Here are 3 diverse suggestions concerning how to tactic the challenge:
Implement an algorithm that calculates the region from the portion of a vertical triangle that overlaps a horizontal line section. When pinpointing the wall polygons, truncate them to return only people parts overlapping the horizontal room boundary segments. Utilize the room's ClosedShell home and determine its intersection area using the wall faces.
Here are somewhat much more in depth descriptions of each approach:
One approach to unravel our latest difficulty would be to apply an algorithm that projects the space boundary curve segments onto the wall face triangles and determines the area of your overlap.
Another strategy might start a bit previously, modifying the utility methods inside the module CmdWallProfile.cs, inside the approach GetWallProfilePolygons, as an illustration by modifying the GetProfile strategy to task its polygons onto the wall site curve, after which chop with the elements that lie exterior the room boundary curve section. The advantage of this can be that our polygon location calculation algorithm might be left unchanged,
Windows 7 Activation Key, since it currently handles all types of polygons, and is also not restricted to triangles.
A 3rd, entirely diverse approach could use the Room object's ClosedShell residence. ClosedShell returns a geometry component, that is a sound, which in this certain sample model is a quadrilateral with six faces and twelve edges. We are able to calculate the overlap with the closed shell faces using the wall faces, that will give us the adjacent surface area.
The great issue concerning the latter method is part of the necessary evaluation has previously been implemented,
Discount Office 2007, from the SDK sample RoofsRooms. It includes a module GeomUtil.cs which implements a strategy AreSolidsCut. This technique analyses regardless of whether anyone room strong face can be a subset of any roof solid face, through which case it returns true. Within the RoofsRooms sample, this method is utilised to ascertain which roof component is covering which area. Within our situation, we'd must expand this method to not only return correct if an overlap is identified, but truly determine the overlapping place. For that moment, this can be left being an physical exercise to the reader. Submissions of doing work options are gladly accepted.
To implement a generic resolution for calculating the place of two overlapping polygons,
Office 2007 Professional Plus, we want a 2D Boolean operation to determine the intersection of two polygons. However, the Revit API isn't going to supply this sort of a Boolean operation from the box.
One might possibly be able to work with the some of the functionality provided by a variety of AutoCAD APIs such as AModeler or regions, by operating AutoCAD from the history and calling a helper software. Needless to say, this needs AutoCAD for being put in within the very same machine as your Revit software, that is not often appealing.
Another and quite possibly less complicated alternative might be to generate use of a free-standing Boolean operation library for polygons. There are a number of them around, when you can see by googling for "polygon boolean" or by investigating the Wikipedia article on Boolean operations on polygons. I've downloaded the Generic Polygon Clipper (gpc) in addition to the C# wrapper GpcWrapper for it, and that appears promising. Please let me know if you already have any knowledge producing utilization of this or some other Boolean libraries in Revit.