For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Intersection of TopoDS_Shape in Java #JCAE

Deepak Agrawal's picture
Forums: 

I am trying to get intersection of two shapes and then view the resulting shape. A part of my code is as below...

BRepAlgoAPI_Section Shape =new BRepAlgoAPI_Section(p1.getShape(), q1.getShape());
TopoDS_Shape Shap1 = Shape.shape();

JFrame cadFrame=new JFrame("jcae-viewer3d-cad demo");
cadFrame.setSize(800,600);
cadFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
final View cadView=new View(cadFrame);
ViewableCAD fcad=new ViewableCAD(new OCCProvider(Shap1));
cadView.add(fcad);
cadView.fitAll();
cadFrame.getContentPane().add(cadView);
cadFrame.setVisible(true);
cadView.setOriginAxisVisible(true);

But I am getting a java.lang.NullPointerException error in the first line. Can anyone please help me in figuring this out?