[Problem hm_createmark "by cylinder"

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Hi,

I would like to know if some of you already used the function : 'hm_createmark 'by cylinder''.

I tried to use it to detect some elements around a line.

The problem is it does not work properly...like returning me elements that have nothing to do with some lines...

 

Initially, i've got a line that goes through my meshed surface.

I take both extremities of the line, and create two nodes at those points.

I allows me to get my cylinder axis and calculate my director vector.

 

Then I do a :

 

hm_createmark elems 1 'by cylinder' '$xnode1 $ynode1 $znode1 $x_vect $y_vect $z_vect 5 $length inside 0 1 0'

Where :

xnode1,ynode1,znode1 is the starting point of my cylinder

x_vect[...]z_vect is my director vector of my cylinder.

 

At the end of the selection i create a surface with each of the elements selected with my cylinder.

 

In the first image (image1.bmp) we have the cylinder 'created' by the createmark.

 

In the second image (image2.bmp) we can see the surfaces created by the process... Not very accurate at all !! We can see that my createmark took elements outside the selection zone...

 

Somebody already had this problem ? Any solution ?

 

The createmark ' by sphere' works well...but in the case i absolutely need the cylinder !

 

Thanks in advance for whoever could help me ...

Unable to find an attachment - read this blog

Answers

  • etrud011
    etrud011 Altair Community Member
    edited July 2018

    Hi,

     

    I know this is a very old thread but, '$x_vect $y_vect $z_vect ' should be points along the cylinders axis, not the direction vector. 'By cylinder' uses two points supplied by the user to generate the direction vector, one for the starting point or origin (x y z) and a second (I j k) to create the direction vector.

     

    -Eric

  • Pandurang
    Pandurang Altair Community Member
    edited July 2018

    Hi,

     

    I would like to know if some of you already used the function : 'hm_createmark 'by cylinder''.

     

     

    I tried to use it to detect some elements around a line.

     

     

    The problem is it does not work properly...like returning me elements that have nothing to do with some lines...

     

     

     

     

     

    Initially, i've got a line that goes through my meshed surface.

     

     

    I take both extremities of the line, and create two nodes at those points.

     

     

    I allows me to get my cylinder axis and calculate my director vector.

     

     

     

     

     

    Then I do a :

     

     

     

     

     

    hm_createmark elems 1 'by cylinder' '$xnode1 $ynode1 $znode1 $x_vect $y_vect $z_vect 5 $length inside 0 1 0'

     

     

    Where :

     

     

    xnode1,ynode1,znode1 is the starting point of my cylinder

     

     

    x_vect[...]z_vect is my director vector of my cylinder.

     

     

     

     

     

    At the end of the selection i create a surface with each of the elements selected with my cylinder.

     

     

     

     

     

    In the first image (image1.bmp) we have the cylinder 'created' by the createmark.

     

     

     

     

     

    In the second image (image2.bmp) we can see the surfaces created by the process... Not very accurate at all !! We can see that my createmark took elements outside the selection zone...

     

     

     

     

     

    Somebody already had this problem ? Any solution ?

     

     

     

     

     

    The createmark ' by sphere' works well...but in the case i absolutely need the cylinder !

     

     

     

     

     

    Thanks in advance for whoever could help me ...

     

     

     

     

    Try this:

     

    # select the 3 nodes (circumfertial) of cylinder at one end
    *createmarkpanel nodes 1 'Select the 3 nodes for first center';
    set ::center_1_x [lindex [hm_getbestcirclecenter nodes 1] 0]
    set ::center_1_y [lindex [hm_getbestcirclecenter nodes 1] 1]
    set ::center_1_z [lindex [hm_getbestcirclecenter nodes 1] 2]
    set ::radius [lindex [hm_getbestcirclecenter nodes 1] 3]

    *createbestcirclecenternode nodes 1 0 1 0
    *clearmark nodes 1
    *createmark nodes 1 -1
    set ::node_1 [hm_getmark nodes 1]
    *clearmark nodes 1

    # select the 3 nodes (circumfertial) of cylinder at other end
    *createmarkpanel nodes 1 'Select the 3 nodes for second center';
    set ::center_2_x [lindex [hm_getbestcirclecenter nodes 1] 0]
    set ::center_2_y [lindex [hm_getbestcirclecenter nodes 1] 1]
    set ::center_2_z [lindex [hm_getbestcirclecenter nodes 1] 2]
    *createbestcirclecenternode nodes 1 0 1 0
    *clearmark nodes 1
    *createmark nodes 1 -1
    set ::node_2 [hm_getmark nodes 1]
    *clearmark nodes 1

    #get length of cylinder
    set ::length [lindex [hm_getdistance nodes $::node_1 $::node_2 0] 0]
     
    *createmark nodes 1 'by cylinder' $::center_1_x $::center_1_y $::center_1_z \
        $::center_2_x $::center_2_y $::center_2_z $::radius $::length inside 1 0 0.5

     

     

    Unable to find an attachment - read this blog