import org.jcae.opencascade.jni.BRepBuilderAPI_MakeFace;
import org.jcae.opencascade.jni.BRepBuilderAPI_MakeWire;
import org.jcae.opencascade.jni.BRepBuilderAPI_Transform;
+import org.jcae.opencascade.jni.BRepFilletAPI_MakeChamfer;
+import org.jcae.opencascade.jni.BRepFilletAPI_MakeFillet;
import org.jcae.opencascade.jni.BRepPrimAPI_MakePrism;
import org.jcae.opencascade.jni.BRepPrimAPI_MakeTorus;
import org.jcae.opencascade.jni.BRep_Builder;
import org.jcae.opencascade.jni.GP_Elips;
import org.jcae.opencascade.jni.GP_Trsf;
+import org.jcae.opencascade.jni.TopAbs_ShapeEnum;
+import org.jcae.opencascade.jni.TopExp_Explorer;
import org.jcae.opencascade.jni.TopoDS_Edge;
import org.jcae.opencascade.jni.TopoDS_Face;
import org.jcae.opencascade.jni.TopoDS_Shape;
F.delete();
return shape;
}
+
+ public static TopoDS_Shape makeFillet(TopoDS_Shape shape, double r) {
+ BRepFilletAPI_MakeFillet fillet = new BRepFilletAPI_MakeFillet(shape);
+
+ TopExp_Explorer exp = new TopExp_Explorer(shape, TopAbs_ShapeEnum.EDGE);
+ while (exp.more()) {
+ TopoDS_Edge e = (TopoDS_Edge) exp.current();
+ fillet.add(r, e);
+ e.delete();
+ exp.next();
+ }
+ TopoDS_Shape result = fillet.shape();
+ exp.delete();
+ shape.delete();
+ fillet.delete();
+ return result;
+
+ }
+
+ public static TopoDS_Shape makeChamfer(TopoDS_Shape shape, double d) {
+ BRepFilletAPI_MakeChamfer fillet = new BRepFilletAPI_MakeChamfer(shape);
+
+ TopExp_Explorer exp = new TopExp_Explorer(shape, TopAbs_ShapeEnum.FACE);
+ while (exp.more()) {
+ TopoDS_Face f = (TopoDS_Face) exp.current();
+ TopExp_Explorer exp2 = new TopExp_Explorer(f, TopAbs_ShapeEnum.EDGE);
+ while (exp2.more()) {
+ TopoDS_Edge e = (TopoDS_Edge) exp2.current();
+ fillet.add(d, e, f);
+ exp2.next();
+ e.delete();
+ }
+ exp2.delete();
+ f.delete();
+ exp.next();
+ }
+ TopoDS_Shape result = fillet.shape();
+ exp.delete();
+ shape.delete();
+ fillet.delete();
+ return result;
+
+ }
public static void exportBREP(TopoDS_Shape shape, String filename) {