How-to: Add Cutting Plane Manipulators and Create Slice in HPS

The HOOPS Visualize 3DF MVO API supported some cutting plane capability which isn’t available in HPS. Specifically, the use of manipulator handles with cutting planes is different. In 3DF, cutting planes are considered geometry to which manipulator handles could be applied.

image-20210528-173250

In HPS, cutting planes are not strictly speaking considered geometry. This articles provides code for placement and manipulation of cutting planes in HPS. Additionally, capability that was available in 3DF such as one, two and three sided sections are supported as well as a thin slice.

Instructions

This capability is supported in HPS by using three classes: CuttingSectionPlacementOperator, CuttingSectionManipulationOperator and a CuttingOpData helper. The code for these classes is available in C++ and C# in the following archive;

CuttingSectionOperators.zip (27.1 KB)

Cutting Section Operators

CuttingSectionPlacementOperator

Use this operator to locate a cutting plane perpendicular to the surface of an object. The normal of the cutting plane will be coincident with the normal of the selected face.

image-20210528-183745

Usage
HPS.View view = _win.GetSprocketsControl().Canvas.GetFrontView();
view.GetOperatorControl().Pop();

Operators.CuttingSectionPlacementOperator hOp = new Operators.CuttingSectionPlacementOperator(HPS.MouseButtons.ButtonLeft());

hOp.Reset();
view.GetOperatorControl().Push(hOp);

CuttingSectionManipulationOperator

Use this operator to translate and rotate an existing cutting plane with manipulator handles.

image-20210528-184304

CuttingSectionManipulationOperator

Use this operator to translate and rotate an existing cutting plane with manipulator handles.

Usage
HPS.View view = _win.GetSprocketsControl().Canvas.GetFrontView();
view.GetOperatorControl().Pop();

Operators.CuttingSectionManipulationOperator hOp = new Operators.CuttingSectionManipulationOperator(HPS.MouseButtons.ButtonLeft(), new HPS.ModifierKeys());

hOp.Reset();
view.GetOperatorControl().Push(hOp);

CuttingOpData

This helper class supports the operators above. It encapsulates the data required to implement the other operators. It is meant to be used internally by these operators to manage state information and implementation.