public class brepfeatures {
static {
try {
System.loadLibrary("CadExCore");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
public static void main(String[] args) {
String aKey = LicenseKey.Value();
if (!LicenseManager.Activate(aKey)) {
System.out.println("Failed to activate CAD Exchanger license.");
System.exit(1);
}
ModelData_Line anExtrusionLine = new ModelData_Line(new ModelData_Point(-2., 0., -4.), ModelData_Direction.XDir());
ModelData_Edge anExtrusionEdge = new ModelData_Edge(anExtrusionLine, 0., 4.);
ModelData_Shape aPlane = ModelAlgo_BRepFeatures.CreateExtrusion(anExtrusionEdge, new ModelData_Vector(0., 4., 0.));
ModelData_Shape aBlock = ModelAlgo_BRepFeatures.CreateExtrusion(aPlane, new ModelData_Vector(0., 0., 8.));
ModelData_Line aRevolutionLine = new ModelData_Line(new ModelData_Point(10., 0., 0.), ModelData_Direction.ZDir());
ModelData_Edge aRevolutionEdge = new ModelData_Edge(aRevolutionLine, 1., 3.);
ModelData_Shape aCircularPlane =
ModelAlgo_BRepFeatures.CreateRevolution(
aRevolutionEdge,
new ModelData_Axis1Placement(new ModelData_Point(10., 0., 0.), ModelData_Direction.YDir()),
Math.PI * 2);
ModelData_Shape aTunnel = ModelAlgo_BRepFeatures.CreateRevolution(aCircularPlane, ModelData_Axis1Placement.OZ(), Math.PI);
ModelData_Model aModel = new ModelData_Model();
ModelData_Part anExtrusionPart = new ModelData_Part(new ModelData_BRepRepresentation(aBlock), new Base_UTF16String("Block"));
aModel.AddRoot(anExtrusionPart);
ModelData_Part aRevolutionPart = new ModelData_Part(new ModelData_BRepRepresentation(aTunnel), new Base_UTF16String("Tunnel"));
aModel.AddRoot(aRevolutionPart);
ModelData_ModelWriter aWriter = new ModelData_ModelWriter();
if (!aWriter.Write(aModel, new Base_UTF16String("Features.cdx"))) {
System.out.println("Unable to save the model!");
System.exit(1);
}
}
}
Defines classes, types, and global functions related to CAD Exchanger.
Definition: A3DSTestLib.hxx:22