| 875 | } |
| 876 | |
| 877 | PyObject* DrawViewPartPy::getVertexByIndex(PyObject *args) |
| 878 | { |
| 879 | int vertexIndex = 0; |
| 880 | if (!PyArg_ParseTuple(args, "i", &vertexIndex)) { |
| 881 | return nullptr; |
| 882 | } |
| 883 | |
| 884 | DrawViewPart* dvp = getDrawViewPartPtr(); |
| 885 | |
| 886 | //this is scaled and +Yup |
| 887 | //need unscaled and +Ydown |
| 888 | TechDraw::VertexPtr vert = dvp->getProjVertexByIndex(vertexIndex); |
| 889 | if (!vert) { |
| 890 | PyErr_SetString(PyExc_ValueError, "Wrong vertex index"); |
| 891 | return nullptr; |
| 892 | } |
| 893 | |
| 894 | Base::Vector3d point = DrawUtil::invertY(vert->point()) / dvp->getScale(); |
| 895 | |
| 896 | gp_Pnt gPoint(point.x, point.y, point.z); |
| 897 | BRepBuilderAPI_MakeVertex mkVertex(gPoint); |
| 898 | TopoDS_Vertex outVertex = mkVertex.Vertex(); |
| 899 | |
| 900 | return new Part::TopoShapeVertexPy(new Part::TopoShape(outVertex)); |
| 901 | } |
| 902 | |
| 903 | PyObject* DrawViewPartPy::getEdgeBySelection(PyObject *args) |
| 904 | { |
nothing calls this directly
no test coverage detected