Skip to content

Commit

Permalink
support for geom-bspline-curve and geom-circle
Browse files Browse the repository at this point in the history
  • Loading branch information
awolven committed Mar 5, 2022
1 parent b353c39 commit 39d40df
Show file tree
Hide file tree
Showing 13 changed files with 112,545 additions and 112,025 deletions.
Binary file modified lib/oc/Windows/AMD64/vc/bind/oc.dll
Binary file not shown.
Binary file modified lib/oc/Windows/AMD64/vc/bind/oc_wrap.exp
Binary file not shown.
Binary file modified lib/oc/Windows/AMD64/vc/bind/oc_wrap.lib
Binary file not shown.
Binary file modified lib/oc/Windows/AMD64/vc/bind/oc_wrap.obj
Binary file not shown.
1 change: 1 addition & 0 deletions oc.asd
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
(:file "src/geom/geom-curve")
(:file "src/geom/geom-bounded-curve")
(:file "src/geom/geom-bezier-curve")
(:file "src/geom/geom-bspline-curve")
(:file "src/geom/geom-trimmed-curve")
(:file "src/geom/geom-surface")
(:file "src/geom/geom-elementary-surface")
Expand Down
4 changes: 4 additions & 0 deletions src/brep-builder-api/brep-builder-api-make-face.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@
(_wrap_BrepBuilderAPI_MakeFace_Face (ff-pointer self))))
(oc:finalize face)
face))

(defmethod add ((self brep-builder-api-make-face) (w topods-wire))
(_wrap_BRepBuilderAPI_MakeFace_Add (ff-pointer self) (ff-pointer w))
(values))
1 change: 1 addition & 0 deletions src/brep-builder-api/brepbuilderapi.i
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class BRepBuilderAPI_MakeFace : public BRepBuilderAPI_MakeShape
BRepBuilderAPI_MakeFace(const Handle_Geom_Surface& S,const TopoDS_Wire& W, const Standard_Boolean Inside = Standard_True );
BRepBuilderAPI_MakeFace(const Handle_Geom_Surface& S, const Standard_Real Umin, const Standard_Real Umax,
const Standard_Real Vmin, const Standard_Real Vmax, const Standard_Real tolDegen);
void Add (const TopoDS_Wire& W);
Standard_Boolean IsDone() const;
BRepBuilderAPI_FaceError Error() const;
const TopoDS_Face& Face() const;
Expand Down
3 changes: 3 additions & 0 deletions src/collections/tcol-std-array1-of-real.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@
(setf (mem-aref p-value :double) (coerce theValue 'double-float))
(_wrap_TColStd_Array1OfReal_SetValue (ff-pointer object) theIndex p-value)
(values)))

(defmethod get-value ((object tcol-std-array1-of-real) (theIndex integer))
(_wrap_TColStd_Array1OfReal_Value (ff-pointer object) theIndex))
9 changes: 9 additions & 0 deletions src/collections/tcol.i
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class TColgp_Array1OfVec {
public:
TColgp_Array1OfVec(const Standard_Integer Low,const Standard_Integer Up);
void SetValue(const Standard_Integer Index,const gp_Vec& Value);
const gp_Vec Value(const Standard_Integer Index);
Standard_Integer Lower (void) const;
Standard_Integer Upper (void) const;
};
%extend TColgp_Array1OfVec
{
Expand All @@ -51,6 +54,9 @@ class TColgp_Array1OfPnt2d {
public:
TColgp_Array1OfPnt2d(const Standard_Integer theLower, const Standard_Integer theUpper);
void SetValue(const Standard_Integer theIndex, const gp_Pnt2d& Value);
const gp_Pnt2d Value(const Standard_Integer Index);
Standard_Integer Lower (void) const;
Standard_Integer Upper (void) const;
};
%extend TColgp_Array1OfPnt2d
{
Expand All @@ -66,6 +72,9 @@ class TColStd_Array1OfReal {
public:
TColStd_Array1OfReal(const Standard_Integer theLower, const Standard_Integer theUpper);
void SetValue(const Standard_Integer theIndex, const Standard_Real& Value);
const Standard_Real Value(const Standard_Integer Index);
Standard_Integer Lower (void) const;
Standard_Integer Upper (void) const;
};

%extend TColStd_Array1OfReal
Expand Down
119 changes: 119 additions & 0 deletions src/geom/geom-bspline-curve.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
(in-package :oc)

(defmethod initialize-instance :after ((instance geom-bspline-curve)
&rest initargs
&key Poles Weights Knots Multiplicities Degree
(Periodic nil Periodic-supplied-p)
(CheckRational t)
&allow-other-keys)
(let ((ff-pointer
(cond ((and (typep Poles 'TCol-gp-Array1-Of-Pnt)
(typep Weights 'TCol-Std-Array1-Of-Real)
(typep Knots 'TCol-std-Array1-Of-Real)
(typep Multiplicities 'TCol-std-Array1-Of-Integer)
(typep Degree 'integer)
Periodic-supplied-p)
(_wrap_new_Geom_BSplineCurve__SWIG_0
(ff-pointer Poles)
(ff-pointer Weights)
(ff-pointer Knots)
(ff-pointer Multiplicities)
Degree
(and Periodic t)
(and CheckRational t)))
((and (typep Poles 'TCol-gp-Array1-Of-Pnt)
(typep Weights 'TCol-Std-Array1-Of-Real)
(typep Knots 'TCol-std-Array1-Of-Real)
(typep Multiplicities 'TCol-std-Array1-Of-Integer)
(typep Degree 'integer))
(_wrap_new_Geom_BSplineCurve__SWIG_2
(ff-pointer Poles)
(ff-pointer Weights)
(ff-pointer Knots)
(ff-pointer Multiplicities)
Degree))
(t (error "Invalid arguments to constructor: ~S" initargs)))))

(setf (ff-pointer instance) ff-pointer)
(oc:finalize instance)
(values)))

(defmethod (setf knot) ((value real) (curve geom-bspline-curve) (index integer))
(oc::_wrap_Geom_BSplineCurve_SetKnot__SWIG_0 (ff-pointer curve) value index))

(defmethod (setf periodic) (value (curve geom-bspline-curve))
(if value
(oc::_wrap_Geom_BSplineCurve_SetPeriodic (ff-pointer curve))
(oc::_wrap_Geom_BSplineCurve_SetNotPeriodic (ff-pointer curve))))

#+NIL
(
(defmethod (setf origin) ((index integer) (curve geom-bspline-curve) &optional (tol 0))
(declare (ignore tol))
(oc::_wrap_Geom_BSplineCurve_SetOrigin__SWIG_0 (ff-pointer index) index))

(defmethod (setf origin) ((u real) (curve geom-bspline-curve) &optional (tol 1.0d-6))
(oc::_wrap_geom_bsplinecurve_SetOrigin__SWIG_1 (ff-pointer curve) u tol))

(defmethod (setf pole) ((p gp:pnt) (curve geom-bspline-curve) (index integer) &optional (weight (oc::_wrap_geom_bsplinecurve_Weight (ff-pointer curve) index)))
(oc::_wrap_geom_bsplinecurve_SetPole__SWIG_1 (ff-pointer curve) index (ptr p) weight))
)
(defmethod move-point ((curve geom-bspline-curve) (u real) (p gp:pnt) (index1 integer) (index2 integer))
(with-foreign-objects ((&first-modified-pole :int)
(&last-modified-pole :int))
(oc::_wrap_Geom_BSplineCurve_MovePoint (ff-pointer curve) u (ptr p) index1 index2 &first-modified-pole &last-modified-pole)
(values (mem-aref &first-modified-pole :int)
(mem-aref &last-modified-pole :int))))

(defmethod move-point-and-tangent ((curve geom-bspline-curve) (u real) (p gp:pnt) (tangent gp:vec) (tolerance real) (starting-condition integer) (ending-condition integer))
(oc::_wrap_Geom_BSplineCurve_MovePointAndTangent (ff-pointer curve) u (ptr p) (ptr tangent) tolerance starting-condition ending-condition))

(defmethod is-rational ((curve geom-bspline-curve))
(oc::_wrap_Geom_BSplineCurve_IsRational (ff-pointer curve)))

(defmethod continuity ((curve geom-bspline-curve))
(oc::_wrap_Geom_BSplineCurve_Continuity (ff-pointer curve)))

(defmethod degree ((curve geom-bspline-curve))
(oc::_wrap_Geom_BSplineCurve_Degree (ff-pointer curve)))

(defmethod local-value ((curve geom-bspline-curve) (u real) (from-k1 integer) (to-k1 integer))
(oc::_wrap_Geom_BSplineCurve_LocalValue (ff-pointer curve) u from-k1 to-k1))

(defmethod end-point ((curve geom-bspline-curve))
(let ((pnt (gp::make-pnt :ptr (oc::_wrap_Geom_BSplineCurve_EndPoint (ff-pointer curve)))))
(oc::finalize pnt)
pnt))

(defmethod start-point ((curve geom-bspline-curve))
(let ((pnt (gp::make-pnt :ptr (oc::_wrap_Geom_BSplineCurve_StartPoint (ff-pointer curve)))))
(oc::finalize pnt)
pnt))

(defmethod nb-knots ((curve geom-bspline-curve))
(oc::_wrap_Geom_BSplineCurve_NbKnots (ff-pointer curve)))

(defmethod nb-poles ((curve geom-bspline-curve))
(oc::_wrap_Geom_BSplineCurve_NbPoles (ff-pointer curve)))

(defmethod get-pole ((curve geom-bspline-curve) (index integer))
(let ((pnt (gp::make-pnt :ptr (oc::_wrap_Geom_BSplineCurve_Pole (ff-pointer curve) index))))
(oc::finalize pnt)
pnt))

(defmethod get-poles ((curve geom-bspline-curve))
(with-foreign-object (pp :pointer)
(oc::_wrap_Geom_BSplineCurve_Poles (ff-pointer curve) pp)
(let ((array (allocate-instance 'oc::TColgp_Array1OfPnt)))
(setf (ff-pointer array) (mem-aref pp :pointer))
(oc::finalize array)
array)))

(defmethod get-weight ((curve geom-bspline-curve) (index integer))
(oc::_wrap_Geom_BSplineCurve_Weight (ff-pointer curve) index))

(defmethod get-knot ((curve geom-bspline-curve) (index integer))
(oc::_wrap_Geom_BSplineCurve_Knot (ff-pointer curve) index))

(defmethod get-multiplicity ((curve geom-bspline-curve) (index integer))
(oc::_wrap_Geom_BSplineCurve_Multiplicity (ff-pointer curve) index))
14 changes: 14 additions & 0 deletions src/geom/geom-circle.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(in-package :oc)

(defmethod initialize-instance :after ((instance geom-circle)
&rest initargs &key A2 R)
(let ((ff-pointer
(cond ((and (typep A2 'gp:ax2) (typep R 'double-float))
(_wrap_new_Geom_Circle (ptr A2) (coerce R 'double-float)))
(t (error "Invalid arguments to constructor: ~S" initargs)))))
(setf (ff-pointer instance) ff-pointer)
(oc:finalize instance)
(values)))

(defmethod radius ((self geom-circle))
(_wrap_Geom_Circle_Radius (ff-pointer self)))
Loading

0 comments on commit 39d40df

Please sign in to comment.