60001812 Get area 3d visibility for solid surfaces from a specific view

Article 60001812
Type Wish
Product Engine
Date Added 9/25/2012 12:00:00 AM
Fixed (9/28/2012 12:00:00 AM)
Submitted by allesio francioso

Summary

I want to get all the visible areas of 3d Surfaces from a specific view.

Solution

In version 6025 we exported a new method to the Document class.

If you have a drawing of a house you can obtain the visible area of the house from different views (for example for wind calculations).
vdPolyhatch , vd3dFace and solid hatched curves are being calculated.

summary>Get the visible area of passed entities at the specified view direction
param name="entities">A collection of vdFigures for which the visible area will be calculated.
param name="VisibleDirection">Visible view direction of clip view plane in World Coordinate System(WCS).
param name="SquareRectSize">Defines the size of small square in Drawing units that each surface is divided. Smaller values gets more time to calculate.
returns>A collection of object type that contains information about the area of each passed vdFigure object.
public VectorDraw.Render.PrimitivesExport.RenderProperties.EntityViewAreas GetVisibleArea(vdEntities entities, Vector VisibleDirection, double SquareRectSize)
Example in c# of the method below :

//Get the projection area in Front View of all entities in Model Layout
//set the equality to 0.01 that is 1 square centimeter in case we assume that 1 DrawingUnit represents 1 meter.The return area value will be in square Drawing Units (square meters in this case)

VectorDraw.Render.PrimitivesExport.RenderProperties.EntityViewAreas ret =document.GetVisibleArea(document.Model.Entities, new Vector(0,-1,0), 0.01);
double surfacesVisibleArea = ret.Area(false); //get the visible area of all entities surfaces.
double ProjectionToViewArea = ret.Area(true); //get the area that projected on the selected view.

You can iterate through the objects like following:
double area = 0.0d;
foreach (EntityViewArea item in ret)
{
vdFigure fig = item.Entity as vdFigure;
area += item.Area(projection);
}

Check out the AreaCalculation project in the VectorDraw Samples solution for more information on how to use this method. You can download the solution from our website's Downloads section.

Send comments on this topic.