{"id":28004,"library":"ocp-gordon","title":"OCP Gordon Surface Interpolation","description":"A Python library for Gordon surface interpolation using B-splines, building on Open CASCADE Technology (OCCT) via OCP. Version 0.2.0 requires Python >=3.10,<3.15. Active development with frequent releases.","status":"active","version":"0.2.0","language":"python","source_language":"en","source_url":"https://github.com/gongfan99/ocp_gordon","tags":["cad","ocp","b-spline","surface-interpolation"],"install":[{"cmd":"pip install ocp-gordon","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"OCP CAD viewer, optional for visualization","package":"ocp-vscode","optional":true},{"reason":"Python bindings for Open CASCADE Technology","package":"OCP","optional":false},{"reason":"Numerical operations","package":"numpy","optional":false}],"imports":[{"note":"Primary class for Gordon surface creation","symbol":"GordonSurface","correct":"from ocp_gordon import GordonSurface"},{"note":"Function is directly under ocp_gordon package, not a submodule","wrong":"from ocp_gordon.surface import make_gordon_surface","symbol":"make_gordon_surface","correct":"from ocp_gordon import make_gordon_surface"}],"quickstart":{"code":"from ocp_gordon import GordonSurface\nfrom OCP.BRepPrimAPI import BRepPrimAPI_MakeBox\nfrom OCP.gp import gp_Pnt\n\n# Create a simple Gordon surface from four corner points\npts = [gp_Pnt(0,0,0), gp_Pnt(1,0,0.5), gp_Pnt(0,1,0.3), gp_Pnt(1,1,0.8)]\nsurf = GordonSurface(pts, degree_u=3, degree_v=3)\n# Convert to shape for further processing\nshape = surf.to_shape()\nprint('Gordon surface created')","lang":"python","description":"Create a Gordon surface from four corner points using bicubic B-spline interpolation."},"warnings":[{"fix":"Ensure points are ordered: [p00, p10, p01, p11] where u varies along rows, v along columns.","message":"The `GordonSurface` constructor expects a list of 4 corner points in order: lower-left, lower-right, upper-left, upper-right. Incorrect ordering produces a twisted surface.","severity":"gotcha","affected_versions":"0.1.0-0.2.0"},{"fix":"Use `shape = surf.to_shape()` instead of `shape = surf.toTopoDS_Shape()`.","message":"In v0.2.0, the `to_shape()` method replaces the deprecated `toTopoDS_Shape()` from v0.1.x. Calling the old method raises AttributeError.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Use `GordonSurface(...)` constructor instead.","message":"The function `make_gordon_surface` (with underscores) is deprecated in v0.2.0 in favor of `GordonSurface` class. It will be removed in v0.3.0.","severity":"deprecated","affected_versions":"0.2.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run `pip install ocp-gordon` and import as `ocp_gordon`.","cause":"Library not installed or installed with different casing (e.g., ocp-gordon vs ocp_gordon).","error":"ModuleNotFoundError: No module named 'ocp_gordon'"},{"fix":"Use `surf.to_shape()` instead, or downgrade to v0.1.x with `pip install ocp-gordon==0.1.18`.","cause":"Method renamed in v0.2.0 from 'toTopoDS_Shape' to 'to_shape'.","error":"AttributeError: 'GordonSurface' object has no attribute 'toTopoDS_Shape'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}