4848from compas_occ .conversions import triangle_to_face
4949from compas_occ .conversions import quad_to_face
5050from compas_occ .conversions import ngon_to_face
51- from compas_occ .geometry import OCCNurbsSurface as NurbsSurface
51+ from compas_occ .geometry import NurbsSurface
5252
5353from compas_occ .brep import BRepVertex
5454from compas_occ .brep import BRepEdge
@@ -61,21 +61,21 @@ class BRep:
6161
6262 Attributes
6363 ----------
64- shape : :class:` TopoDS_Shape`
64+ shape : `` TopoDS_Shape` `
6565 The underlying OCC shape of the BRep.
66- type : :class:` TopAbs_ShapeEnum`, read-only
67- One of `{TopAbs_COMPOUND, TopAbs_COMPSOLID, TopAbs_SOLID, TopAbs_SHELL, TopAbs_FACE, TopAbs_WIRE, TopAbs_EDGE, TopAbs_VERTEX, TopAbs_SHAPE}` .
68- vertices : list[:class:`BRepVertex`], read-only
66+ type : `` TopAbs_ShapeEnum` `, read-only
67+ The type of BRep shape .
68+ vertices : list[:class:`compas_occ.brep. BRepVertex`], read-only
6969 The vertices of the BRep.
70- edges : list[:class:`BRepEdge`], read-only
70+ edges : list[:class:`compas_occ.brep. BRepEdge`], read-only
7171 The edges of the BRep.
72- loops : list[:class:`BRepLoop`], read-only
72+ loops : list[:class:`compas_occ.brep. BRepLoop`], read-only
7373 The loops of the BRep.
74- faces : list[:class:`BRepFace`], read-only
74+ faces : list[:class:`compas_occ.brep. BRepFace`], read-only
7575 The faces of the BRep.
76- orientation : :class:` TopAbs_Orientation` , read-only
77- One of `{TopAbs_FORWARD, TopAbs_REVERSED, TopAbs_INTERNAL, TopAbs_EXTERNAL}` .
78- frame : :class:`Frame`, read-only
76+ orientation : TopAbs_Orientation, read-only
77+ Orientation of the shape .
78+ frame : :class:`compas.geometry. Frame`, read-only
7979 The local coordinate system of the BRep.
8080 area : float, read-only
8181 The surface area of the BRep.
@@ -195,7 +195,7 @@ def from_corners(cls,
195195 p1 : :class:`compas.geometry.Point`
196196 p2 : :class:`compas.geometry.Point`
197197 p3 : :class:`compas.geometry.Point`
198- p4 : :class:`compas.geometry.Point`
198+ p4 : :class:`compas.geometry.Point`, optional
199199
200200 Returns
201201 -------
@@ -238,12 +238,12 @@ def from_polygons(cls, polygons: List[compas.geometry.Polygon]) -> 'BRep':
238238 return brep
239239
240240 @classmethod
241- def from_curves (cls , curves ) -> 'BRep' :
241+ def from_curves (cls , curves : List [ compas . geometry . NurbsCurve ] ) -> 'BRep' :
242242 """Construct a BRep from a set of curves.
243243
244244 Parameters
245245 ----------
246- curves : list[:class:`compas_occ .geometry.OCCNurbsCurve `]
246+ curves : list[:class:`compas .geometry.NurbsCurve `]
247247
248248 Returns
249249 -------
@@ -449,6 +449,7 @@ def to_json(self, filepath: str):
449449 Parameters
450450 ----------
451451 filepath : str
452+ Location of the file.
452453
453454 Returns
454455 -------
@@ -464,8 +465,11 @@ def to_step(self, filepath: str, schema: str = "AP203", unit: str = "MM") -> Non
464465 Parameters
465466 ----------
466467 filepath : str
468+ Location of the file.
467469 schema : str, optional
470+ STEP file format schema.
468471 unit : str, optional
472+ Base units for the geometry in the file.
469473
470474 Returns
471475 -------
@@ -499,7 +503,9 @@ def to_meshes(self, u=16, v=16):
499503 Parameters
500504 ----------
501505 u : int, optional
506+ The number of mesh faces in the U direction of the underlying surface geometry of every face of the BRep.
502507 v : int, optional
508+ The number of mesh faces in the V direction of the underlying surface geometry of every face of the BRep.
503509
504510 Returns
505511 -------
@@ -511,7 +517,7 @@ def to_meshes(self, u=16, v=16):
511517 brep .shape = converter .Shape ()
512518 meshes = []
513519 for face in brep .faces :
514- srf = NurbsSurface .from_face (face )
520+ srf = NurbsSurface .from_face (face . face )
515521 mesh = srf .to_vizmesh (u , v )
516522 meshes .append (mesh )
517523 return meshes
@@ -574,24 +580,77 @@ def is_convex(self) -> bool:
574580 return self .shape .Convex ()
575581
576582 def is_manifold (self ) -> bool :
583+ """Check if the shape is manifold.
584+
585+ Returns
586+ -------
587+ bool
588+
589+ Notes
590+ -----
591+ A BRep is non-manifold if at least one edge is shared by more than two faces.
592+
593+ """
577594 pass
578595
579596 def is_solid (self ) -> bool :
597+ """Check if the shape is a solid.
598+
599+ Returns
600+ -------
601+ bool
602+
603+ """
580604 pass
581605
582606 def is_surface (self ) -> bool :
607+ """Check if the shape is a surface.
608+
609+ Returns
610+ -------
611+ bool
612+
613+ """
583614 pass
584615
585616 def cull_unused_vertices (self ) -> None :
617+ """Remove all unused vertices.
618+
619+ Returns
620+ -------
621+ None
622+
623+ """
586624 pass
587625
588626 def cull_unused_edges (self ) -> None :
627+ """Remove all unused edges.
628+
629+ Returns
630+ -------
631+ None
632+
633+ """
589634 pass
590635
591636 def cull_unused_loops (self ) -> None :
637+ """Remove all unused loops.
638+
639+ Returns
640+ -------
641+ None
642+
643+ """
592644 pass
593645
594646 def cull_unused_faces (self ) -> None :
647+ """Remove all unused faces.
648+
649+ Returns
650+ -------
651+ None
652+
653+ """
595654 pass
596655
597656 # flip
@@ -611,5 +670,19 @@ def cull_unused_faces(self) -> None:
611670 # translate
612671 # unjoin edges
613672
614- def contours (self , plane : compas .geometry .Plane , spacing : Optional [float ] = None ) -> List [List [compas .geometry .Polyline ]]:
673+ def contours (self ,
674+ planes : List [compas .geometry .Plane ]) -> List [List [compas .geometry .Polyline ]]:
675+ """Generate contour lines by slicing the BRep shape with a series of planes.
676+
677+ Parameters
678+ ----------
679+ planes : list[:class:`compas.geometry.Plane`]
680+ The slicing planes.
681+
682+ Returns
683+ -------
684+ list[list[:class:`compas.geometry.Polyline`]]
685+ A list of polylines per plane.
686+
687+ """
615688 pass
0 commit comments