Skip to content

OCP 8.0.1: BRepCheck_Result.Status() and Bnd_Box.Get() return unbound types #232

Open

Description

@Sean-yh

Two OCCT return types have no binding in OCP 8.0.1, so the methods that return them raise instead of returning. Both worked on 7.9.3.1, where they came back as BRepCheck_ListOfStatus and a 6-tuple.

Method OCCT 8 return type OCP 7.9.3.1 OCP 8.0.1.1
BRepCheck_Result.Status() NCollection_List<BRepCheck_Status> BRepCheck_ListOfStatus TypeError
Bnd_Box.Get() Bnd_Box::Limits (xmin, ymin, zmin, xmax, ymax, zmax) TypeError
from OCP.BRepPrimAPI import BRepPrimAPI_MakeBox
from OCP.BRepCheck import BRepCheck_Analyzer
from OCP.Bnd import Bnd_Box
from OCP.BRepBndLib import BRepBndLib
from OCP.TopExp import TopExp_Explorer
from OCP.TopAbs import TopAbs_FACE

box = BRepPrimAPI_MakeBox(10, 20, 30).Shape()
face = TopExp_Explorer(box, TopAbs_FACE).Current()
BRepCheck_Analyzer(box).Result(face).Status()

bb = Bnd_Box()
BRepBndLib.Add_s(box, bb)
bb.Get()

On cadquery-ocp-novtk==8.0.1.1.0 (macOS arm64, Python 3.13):

TypeError: Unable to convert function return value to a Python type! The signature was
	(self: OCP.OCP.BRepCheck.BRepCheck_Result) -> NCollection_List<BRepCheck_Status>
TypeError: Unable to convert function return value to a Python type! The signature was
	(self: OCP.OCP.Bnd.Bnd_Box) -> Bnd_Box::Limits

OCP.collections has no list of BRepCheck_Status (the only *Status instantiation is DataMap_AIS_InteractiveObject_AIS_GlobalStatus), and OCP.Bnd has no Limits. These look like the same gap as #217 (an instantiation the generator didn't pick up) and a nested struct that isn't exposed.

The first one costs the most: Status() is the only way to read why BRepCheck_Analyzer rejects a sub-shape, so on 8.0 a checker can say "invalid" but not "self-intersecting wire" or "unclosed shell". The workaround we use in text-to-cad re-runs the per-kind checks (BRepCheck_Shell.Closed()/.Orientation(), BRepCheck_Face.IntersectWires()/.ClassifyWires(), BRepCheck_Wire.Closed()), which return a single BRepCheck_Status and still bind, but it misses whatever those don't cover. For Get(), CornerMin()/CornerMax() give the same numbers.

Activity

  1. jdegenstein commented on Oct 21, 2026

    @jdegenstein
    Contributor
  2. Sean-yh commented on Oct 25, 2026

    @Sean-yh
    Author

    Thanks @jdegenstein, the GetXMin… route works for us too.

    One more of the same kind, which we hit porting a downstream app to 8.0.1: the EmissiveFactor field of XCAFDoc_VisMaterialPBR (an NCollection_Vec3<float>) isn't bound anymore. The field is still in OCCT 8, since DumpJson prints it, but there's no attribute to read or set, so the emissive colour of an XCAF material can't round-trip through Python:

    import io
    from OCP.XCAFDoc import XCAFDoc_VisMaterialPBR
    
    pbr = XCAFDoc_VisMaterialPBR()
    dump = io.BytesIO()
    pbr.DumpJson(dump)
    print('"EmissiveFactor"' in dump.getvalue().decode())   # True: the field is there
    print(hasattr(pbr, "EmissiveFactor"))                     # 7.9: True, 8.0.1: False

    On 7.9.3.1 both lines print True. On 8.0.1.1 the second prints False. Presumably it's the same cause as the others: the member's type is now an NCollection template instantiation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions