{"action":"created","issue":{"url":"https://api.github.com/repos/tpaviot/oce/issues/615","repository_url":"https://api.github.com/repos/tpaviot/oce","labels_url":"https://api.github.com/repos/tpaviot/oce/issues/615/labels{/name}","comments_url":"https://api.github.com/repos/tpaviot/oce/issues/615/comments","events_url":"https://api.github.com/repos/tpaviot/oce/issues/615/events","html_url":"https://github.com/tpaviot/oce/issues/615","id":152194373,"number":615,"title":"Scaled cylinder yields invalid shape","user":{"login":"aothms","id":1096535,"avatar_url":"https://avatars.githubusercontent.com/u/1096535?v=3","gravatar_id":"","url":"https://api.github.com/users/aothms","html_url":"https://github.com/aothms","followers_url":"https://api.github.com/users/aothms/followers","following_url":"https://api.github.com/users/aothms/following{/other_user}","gists_url":"https://api.github.com/users/aothms/gists{/gist_id}","starred_url":"https://api.github.com/users/aothms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aothms/subscriptions","organizations_url":"https://api.github.com/users/aothms/orgs","repos_url":"https://api.github.com/users/aothms/repos","events_url":"https://api.github.com/users/aothms/events{/privacy}","received_events_url":"https://api.github.com/users/aothms/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-01T11:16:01Z","updated_at":"2016-05-01T12:23:39Z","closed_at":"2016-05-01T12:23:39Z","body":"Hi all,\r\n\r\nPlease find attached a trivial example program that yields an invalid shape by using `TopoDS_Shape::Move()` on a shape with a `Geom_CylindricalSurface` and a `gp_Trsf` with scale factor.\r\n\r\n~~~\r\n#include <gp_Trsf.hxx>\r\n#include <Geom_Circle.hxx>\r\n\r\n#include <BRepBuilderAPI_MakeWire.hxx>\r\n#include <BRepBuilderAPI_MakeEdge.hxx>\r\n#include <BRepBuilderAPI_MakeFace.hxx>\r\n#include <BRepBuilderAPI_Transform.hxx>\r\n\r\n#include <BRepPrimAPI_MakePrism.hxx>\r\n\r\n#include <TopoDS_Iterator.hxx>\r\n\r\n#include <BRepCheck.hxx>\r\n#include <BRepCheck_Result.hxx>\r\n#include <BRepCheck_Analyzer.hxx>\r\n#include <BRepCheck_ListOfStatus.hxx>\r\n#include <BRepCheck_ListIteratorOfListOfStatus.hxx>\r\n\r\n#include <BRepTools.hxx>\r\n\r\nint main(int argc, char** argv) {\r\n\tHandle(Geom_Circle) circle = new Geom_Circle(gp_Ax2(), 400.);\r\n\tBRepBuilderAPI_MakeWire wire;\r\n\twire.Add(BRepBuilderAPI_MakeEdge(circle));\r\n\tTopoDS_Shape cylinder = BRepPrimAPI_MakePrism(BRepBuilderAPI_MakeFace(wire, false), gp_Vec(0, 0, 4000)).Shape();\r\n\t\r\n\t{\r\n\t\tBRepCheck_Analyzer valid(cylinder);\r\n\t\tbool validity = valid.IsValid();\r\n\t\tstd::cout << validity << std::endl;\r\n\t}\r\n\t\r\n\tgp_Trsf trsf;\r\n\ttrsf.SetScaleFactor(0.1);\r\n\tTopoDS_Shape scaled_cylinder = cylinder.Moved(trsf);\r\n\r\n\t{\r\n\t\tBRepCheck_Analyzer valid(scaled_cylinder);\r\n\t\tbool validity = valid.IsValid(); \r\n\t\tstd::cout << validity << std::endl;\r\n\t}\r\n\r\n\tscaled_cylinder = BRepBuilderAPI_Transform(cylinder, trsf);\r\n\r\n\t{\r\n\t\tBRepCheck_Analyzer valid(scaled_cylinder);\r\n\t\tbool validity = valid.IsValid();\r\n\t\tstd::cout << validity << std::endl;\r\n\t}\r\n}\r\n~~~\r\n\r\nResults in:\r\n~~~\r\n1\r\n0\r\n1\r\n~~~\r\n\r\n(in other words, the unscaled cylinder is valid, the scaled cylinder with `TopoDS_Shape::Move()` is not, `BRepBuilderAPI_Transform` does yield a valid shape on the same operands)\r\n\r\nI did some debugging and it boils down to\r\n\r\n1. a `BRepCheck_UnorientableShape` being issued for the 'cylindrical' `TopoDS_Face`\r\n2. This is due to a `BRepCheck_InvalidCurveOnSurface` being issued for one of its edges\r\nhttps://github.com/tpaviot/oce/blob/c0cdb53fdf7cc708eb303bec49b18e27edd7c74b/src/BRepCheck/BRepCheck_Analyzer.cxx#L257\r\n3. This is due to the distance between points on the pcurve and 3d curve being a factor 10 away from each other in the Z-axis. Which seems to indicate the somehow the transformation does get applied to only one of them.\r\nhttps://github.com/tpaviot/oce/blob/c0cdb53fdf7cc708eb303bec49b18e27edd7c74b/src/BRepCheck/BRepCheck_Edge.cxx#L718\r\n\r\nI'm in way over my head here. Appreciate some help. Thanks all."},"comment":{"url":"https://api.github.com/repos/tpaviot/oce/issues/comments/216038510","html_url":"https://github.com/tpaviot/oce/issues/615#issuecomment-216038510","issue_url":"https://api.github.com/repos/tpaviot/oce/issues/615","id":216038510,"user":{"login":"aothms","id":1096535,"avatar_url":"https://avatars.githubusercontent.com/u/1096535?v=3","gravatar_id":"","url":"https://api.github.com/users/aothms","html_url":"https://github.com/aothms","followers_url":"https://api.github.com/users/aothms/followers","following_url":"https://api.github.com/users/aothms/following{/other_user}","gists_url":"https://api.github.com/users/aothms/gists{/gist_id}","starred_url":"https://api.github.com/users/aothms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aothms/subscriptions","organizations_url":"https://api.github.com/users/aothms/orgs","repos_url":"https://api.github.com/users/aothms/repos","events_url":"https://api.github.com/users/aothms/events{/privacy}","received_events_url":"https://api.github.com/users/aothms/received_events","type":"User","site_admin":false},"created_at":"2016-05-01T12:23:39Z","updated_at":"2016-05-01T12:23:39Z","body":"Dear Andrey,\r\n\r\nGreat! Thanks.\r\n\r\nKind regards,\r\nThomas\r\n"}}