Last active
July 24, 2017 13:43
-
-
Save ghedin/c2481a6d255bd5d09f13561e8471490b to your computer and use it in GitHub Desktop.
OCCT - Approximate Surface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// plate builder | |
GeomPlate_BuildPlateSurface aPlateBuilder(Degree, NbPtsOnCur, NbIter, Tol2d, Tol3d, TolAng, TolCurv); | |
Standard_Real dmax = 1.1 * aPlateBuilder.G0Error(); | |
TColgp_SequenceOfXY S2d; | |
TColgp_SequenceOfXYZ S3d; | |
aPlateBuilder.Disc2dContour(4, S2d); | |
aPlateBuilder.Disc3dContour(4, 0, S3d); | |
GeomPlate_PlateG0Criterion Criterion(S2d, S3d, dmax); | |
const Handle(GeomPlate_Surface)& GPlate = plateBuilder.Surface(); | |
// approximate bspline surface | |
GeomPlate_MakeApprox Approx(GPlate, Criterion, Tol3d, MaxSegments, MaxDeg); | |
Handle(Geom_BSplineSurface) Surface = Approx.Surface(); | |
// create a TopoDS_Face with the BSpline Surface | |
BRepBuilderAPI_MakeFace BB(Surface, Precision::Approximation()); // this won't compile. | |
// VISUAL STUDIO 2013 COMPILER OUTPUT: | |
// opencascade_7_1_0\inc\Standard_Handle.hxx(122): error C2440: 'static_cast' : cannot convert from 'Standard_Transient *const ' to 'Geom_BSplineSurface *' | |
// Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast | |
// opencascade_7_1_0\inc\Standard_Handle.hxx(122) : while compiling class template member function 'Geom_BSplineSurface *opencascade::handle<Geom_BSplineSurface>::get(void) const' | |
// make_face.cpp(16) : see reference to function template instantiation 'Geom_BSplineSurface *opencascade::handle<Geom_BSplineSurface>::get(void) const' being compiled | |
// opencascade_7_1_0\inc\GeomAdaptor_Surface.hxx(274) : see reference to class template instantiation 'opencascade::handle<Geom_BSplineSurface>' being compiled | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment