Hello,
I just found a bug with geompy.kindOfShape(face) when face is a cone2D face.
following the documentation SALOME Geometry User's Guide: Auxiliary data structures and methods
if face is a cone2D
the result of geompy.kindOfShape(face) should look similar to this:
[CONE2D, xc, yc, zc, dx, dy, dz, R_1, R_2 H]
so, center in (xc,yc,zc)
auxPoint in (xc+dx, yc+dy, zc+dz)
axis a vector between center and auxPoint
minorRadius equal to R_1
mayorRadius equal to R_2
and a height of H
so to recreate the cone of the surface (following the documentation) one should do:
infoOfFace=geompy.KindOfShape(face)
center=geompy.MakeVertex(infoOfFace[1], infoOfFace[2], infoOfFace[3])
vertNorm=geompy.MakeVertex(infoOfFace[1]+infoOfFace[4], infoOfFace[2]+infoOfFace[5], infoOfFace[3]+infoOfFace[6])
axis=geompy.MakeVector(center, vertNorm)
radius_0=infoOfFace[7]
radius_1=infoOfFace[8]
height=infoOfFace[9]
completeCone=geompy.MakeCone(center, axis, radius_0,radius_1, height)
geompy.addToStudy(completeCone,'completeCone')
geompy.addToStudy(face,'face')
but as it can be seen in the image: the completeCone is not correctly created.
(outside of the direction that could be a missing sign somewhere in the calculation which I find strange as with the other kindOfShape I have tested it has succesfully create the corresponding related body without orientation issues), the issue is that the geompy.kindOfShape(face) is returning one of two wrong parameters, or the heigh(H) or the radius 2 (R_2), as the result gives the following result:
[CONE2D, 0.0005, 0.0, 0.0005, 0.0, 0.0, -1.0, 0.00075, 0.0, 0.0006000000000000003]
which would indicate that is a cone of R_1=0.00075, R_2=0.0 (meaning is a complete cone), and a height=0.0006 the thing is:
- the height is correct but then R_2 should be equal to 0.0005 (and not 0.0)
or
- the R_2 is correct but then the height should be equal to 0.0018 (and not 0.0006)
here is the sketch of the original geometry:
and the STEP model attached:
cone2d.step (4,2 KB)
@cbourcier I am tagging you as this is part of last developments, might be usefull to find the issue before is burried by development
regards,