Skip to content

Instantly share code, notes, and snippets.

@ghedin
ghedin / vector.py
Last active February 2, 2024 05:47 — forked from mcleonard/vector.py
A vector class in pure python.
"""
The MIT License (MIT)
Copyright (c) 2015 Mat Leonard
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@ghedin
ghedin / make_face.cpp
Last active July 24, 2017 13:43
OCCT - Approximate Surface
// 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();