70000099 I would like to have a Slice method that also returns the rejected faces

Article 70000099
Type Wish
Product Engine
Date Added 10/10/2014 12:00:00 AM
Fixed (10/10/2014 12:00:00 AM)
Submitted by Wesley Beere

Summary

I would like to have a Slice method that also returns the rejected faces

Solution

In version 7002 we added a new override method of the vdPolyface's Slice like Below

summary: Changes the vertexlist and facelist of the polyface in order to be sliced using a plane from the passed parameters.
param name="origin": A point needed to determine the slice plane.
param name="direction": A Vector that is perpendicular to the plane and specifies the direction of the eliminated portion of the polyface.
param name="CreateCoverFaces": A boolean value representing if extra faces will be added in order to cover the cutted edges.
param name="CreatedFacesEdgesVisibility": A boolean value representing the edges visibility of the created cover faces.
param name="RejectedPolyface": If it is a newlly created polyface then here will be added the rejected faces of the operation , can be null so the faces are not added.
returns: True if the operation was succesfull. False is returned if none face is being Sliced.

public bool Slice(gPoint origin, Vector direction, bool CreateCoverFaces, bool CreatedFacesEdgesVisibility , vdPolyface RejectedPolyface)

C# Example

   vdPolyface face = new vdPolyface(doc);
   face.CreateSphere(new gPoint(5, 5), 2.7, 50, 50);
   Vector v = new Vector();
   v.CalculateExtrution(new gPoint(10, 5), new gPoint(5, 10), new gPoint(10, 5, 5));
   
   vdPolyface Rejected = new vdPolyface();
   face.Slice(new gPoint(5.5, 5), v, true, true, Rejected);
   doc.Model.Entities.AddItem(face);
   doc.Model.Entities.AddItem(Rejected);
   doc.Redraw(true);

Send comments on this topic.