Skip to content

SkipShared = True calculates too many edges for a shared edge #1268

Open
@rozzzi

Description

@rozzzi

Hi,

When using the LinearProperties function from BRepGProp to calculate the length of the edges of a unit cube, the total length of the edges should be 24 if Skipshared=False and 12 if SkipShared=True, because every edge is shared by two faces. SkipShared=True should take edges that are shared by two or more faces only once according to the OCC documentation (https://dev.opencascade.org/doc/refman/html/class_b_rep_g_prop.html).
When using this function to calculate the edges of a TopoDS_Compound shape that consists of 2 unit cubes that share 1 face exactly (resulting in a 1x1x2 shape), one would assume that with SkipShared = False this would result in a total edge length of 24 + 24 = 48, as the middle edges are shared by both cubes but will still be counted for every face it is an edge of.
With SkipShared = True, one would expect a total edge length of 8 + 4 + 8 = 20, as the middle 4 edges are shared by 4 faces each, but should only be counted once. However, the outcome of the function is 24. Presumably this is because the edges shared by faces within unit cubes are only counted once, but when the edges overlap they are counted individually, even though they are in fact 1 edge, and share two or more faces but should only be counted once. Alternatively, one could state that these are not edges anymore, because the shape has become 1 big shape, and the shared face is not a face anymore (so the total edge length would be 4+8+4 = 16).
Is this how the code is supposed to work? If so, is there a different function that would essentially do what I am trying to calculate?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions