/*************************************/ /** 获取边界坐标 **/ /*************************************/ void get_bndBox_Coordinates(intPtr elementId, double *theXmin,double *theYmin,double *theZmin, double *theXmax,double *theYmax, double *theZmax) { shape_data *pobj = reinterpret_cast<shape_data *>(elementId); TopoDS_Shape shape = *pobj->ptrShape; Bnd_Box box; box.SetGap(0.001); //边界距离 BRepBndLib ret; ret.Add(shape, box, Standard_True); box.Get(*theXmin, *theYmin, *theZmin, *theXmax, *theYmax, *theZmax); qDebug()<< "xxx" << *theXmin << *theYmin << *theXmax << *theYmax << *theZmax; }
OpenCasCade 获取3维图元包围盒坐标
于 2020-10-19 21:38:50 首次发布