Anonymous | Login | 2021-01-17 19:05 MSK | ![]() |
My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
0031605 | Community | [OCCT] OCCT:Foundation Classes | public | 2020-06-10 11:42 | 2020-06-10 11:42 | ||||||||
Reporter | aothms | ||||||||||||
Assigned To | abv | ||||||||||||
Priority | normal | Severity | minor | ||||||||||
Status | new | Resolution | open | ||||||||||
Platform | OS | OS Version | |||||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0031605: gp_GTrsf::SetVectorialPart sets scale to 0.0 causing non-invertable matrix | ||||||||||||
Description | I sometimes get a 4x4 matrix from external sources that I want to convert to a shape location. So I use gp_GTrsf, check form, convert to gp_Trsf and TopLoc_Location. The most straightforward way to do this is to use gp_GTrsf::SetVectorialPart(), but that sets the internal scale value to 0.0. I don't think this is necessary: there is code in OCCT to calculate scale from the gp_Mat I think and I also don't know why gp_GTrsf carries a single scale value as it allows non-uniform scale. I'd happily provide a fix if I get some guidance on the most desirable way to address this. | ||||||||||||
Steps To Reproduce | Execute the code below and witness an exception in gp_Trsf::Invert() --------------- #include <gp_Mat.hxx> #include <gp_GTrsf.hxx> #include <TopLoc_Location.hxx> #include <BRep_Tool.hxx> #include <BRepBuilderAPI_MakeFace.hxx> #include <gp_Pln.hxx> #include <TopoDS_Face.hxx> #include <TopExp_Explorer.hxx> #include <TopoDS.hxx> #include <TopoDS_Edge.hxx> int main(int, char**) { gp_Mat mat(gp::DX().XYZ(), gp::DY().XYZ(), gp::DZ().XYZ()); gp_GTrsf trsf; trsf.SetVectorialPart(mat); trsf.SetForm(); TopLoc_Location loc(trsf.Trsf()); TopoDS_Face f = BRepBuilderAPI_MakeFace(gp_Pln(), 0.1, 0.1, 0.2, 0.2).Face(); f.Move(loc); TopExp_Explorer exp(f, TopAbs_EDGE); TopoDS_Edge e = TopoDS::Edge(exp.Current()); double u0, u1; BRep_Tool::CurveOnSurface(e, f, u0, u1); } -------------- | ||||||||||||
Tags | No tags attached. | ||||||||||||
Test case number | |||||||||||||
Attached Files | |||||||||||||
![]() |
|||
Date Modified | Username | Field | Change |
2020-06-10 11:42 | aothms | New Issue | |
2020-06-10 11:42 | aothms | Assigned To | => abv |
Copyright © 2000 - 2021 MantisBT Team |