Find pairs of opposite surfaces to an element.

Jouher_20929
Jouher_20929 Altair Community Member
edited October 2020 in Community Q&A

I have an FE inside a CAD. for any FE element, I have to get opposite paired surfaces.

 

Any solution?

 

Pls help. @tinh @vipin

Answers

  • tinh
    tinh Altair Community Member
    edited November 2018

    Try find closest surf from elem center

  • Jouher_20929
    Jouher_20929 Altair Community Member
    edited November 2018

    @tinh Passing list of all surfaceid to get closest surface makes code slow. Do you know any code without passing surface id list?

     

    Secondly, if its a single surface cad, then i will not get opposite surfaces, instead i get surfaces on same plane using closest surface. How to check this?

  • tinh
    tinh Altair Community Member
    edited November 2018

    yes, hm_getclosestsurface is very slow

    using hm_measureshortestdistance is faster

     

    after finding the closest surf, use hm_markremove to remove it from surf mark, and continue searching next closest surf

  • Jouher_20929
    Jouher_20929 Altair Community Member
    edited November 2018

    yes, hm_getclosestsurface is very slow

    using hm_measureshortestdistance is faster

     

    after finding the closest surf, use hm_markremove to remove it from surf mark, and continue searching next closest surf

    Ple

     

    @tinh Passing list of all surfaceid to get closest surface makes code slow. Do you know any code without passing surface id list?

     

    Secondly, if its a single surface cad, then i will not get opposite surfaces, instead i get surfaces on same plane using closest surface. How to check this?

    Clarify abt my second doubt. @tinh

  • tinh
    tinh Altair Community Member
    edited November 2018

    Secondary,...

    => to check it, you can compare normal vector of 2 surfs, in case of single surf cad, 2 normal vectors have same direction

    otherwise, they have inversed normals

    hm_triplecos may help

  • Jouher_20929
    Jouher_20929 Altair Community Member
    edited November 2018

    @tinh Can you elaborate. Pls.

  • tinh
    tinh Altair Community Member
    edited November 2018

    Once you find the closest surf, find its normal by hm_getsurfacenormalatcoord

  • Jouher_20929
    Jouher_20929 Altair Community Member
    edited December 2018

    @tinh i am using hm_triplecos function. what is happening is sometimes it gives +1 or -1 for opposite surfaces/parallel surfaces both. so, getting opposite surfaces in case of ribs fails in some areas. that is, it may get surface of nearby rib too in case of plastics. what to do?

  • tinh
    tinh Altair Community Member
    edited December 2018

    Unify comps with normal + (red outer)

    Then search nearest surface in normal - only, ignore surf with triplecos +1

  • Jouher_20929
    Jouher_20929 Altair Community Member
    edited December 2018

    @tinh how to 'Unify comps with normal + (red outer)?'

  • tinh
    tinh Altair Community Member
    edited December 2018

    Enter panel normals>surfs to adjust it

  • Jouher_20929
    Jouher_20929 Altair Community Member
    edited December 2018

    @tinh, will be helpful in plastic comps with full of ribs?

  • tinh
    tinh Altair Community Member
    edited December 2018

    Please try and if it is not helpful, tell us reason