🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Intersection Line/Element

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

Hi !

I am currently working on a macro for HyperMesh.

My problem right now is that i have a 2D mesh and some line going through many elements and i want to get the elements that are being crossed by a line.

 

To schematize the thing :

 

 

__l___l_l____l_____l_______l____   

    l      l  l        l          l              l

 

where ' l ' represents my lines and '_' my 2D elements.

 

I want to write a subroutine that could do :

 

 

 foreach lines $LineList {

 

        Give me the element that the line is going through

           

}

 

 

Any ideas how to do this ?

 

I was thinking of creating a 1D element that would replace the line and then try to look for the intersection of both elements (1D/2D) but i can't find out how !!

Maybe with the the hm_collision function, anyone already used it ?

 

Thanks a lot in advance !

 

 

Clément

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Maybe try to create a temporary surface for each 2D element and look for intersection between the line and surface through the function *nodecreateatintersection ? If intersection node found you got the element and so on.

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Thanks for your answer.

    I was searching for a more direct solution only considering the elements.

    But seems like you have a good solution here !

     

    I will reduce the number of temporary surfaces to create with a hm_createmark elems 1 ' by cylinder',  basing the cylinder characteristics on the nodes of my lines.

     

    Again thank you !