Jump to content
Pandurang

internal nodes selection

Recommended Posts

Hi all,

 

I want to select the internal nodes for any nonuniform hole. So for same i want to write a tcl script. any idea?

I have written script for cylindrical hole. it works perfectly. but what if it is not cylindrical hole.

please suggest me any solution.

Share this post


Link to post
Share on other sites

Hi

suggestion for you:

- find free edge

- isolate only ^edges

- find edge element by initial node

- find attached edge elements

- find nodes attached to those elements => hole nodes

Share this post


Link to post
Share on other sites

Hi Tinh,

 

Thanks for your valuable suggestion.

 

Please refer the attachments for model.

My model looks similar having tetra mesh (but it could be of any type).

This model is of two part (upper and lower ) it has some small holes on middle part.

could you please suggest some API.

script should select internal nodes for any kind of model similar to one which i attached.

 

Thanks & Regards,

Pandurang

 

 

Axle_Beam_2.PNG.5ecb98f9316dbc54d4f72a408b6c5523.PNGAxle_Beam_1.PNG.54bbe05c8dd03c15983615b82d30eb6c.PNG

 

Share this post


Link to post
Share on other sites

Hi Tinh,

Thanks for reply.

 

I think this wont work in my case. see attached images details of upper part.

right now i am able select the nodes by changing feature angle.

but every model wont work.

I want to create tool with little user interaction, so that it work every time.

i am just beginner  in hm customization.

What you say?

 

Thanks & Regards,

PD

 

 

axle_beam_1.PNG

axle_beam_2.PNG

axle_beam_3.PNG

Share this post


Link to post
Share on other sites

If the hole is not cylindrical, you have to know its mathematical formulation, othewise it is impossible applied for every model

I can do it base on shape of model but it cost much time

Share this post


Link to post
Share on other sites

ok.

 

Would u please guide me to get the solution for this model?

one solution i thick of is:

1. create plane whose normal is axis of model.

2. get the intersection node.

3. translating plane along axis to get intersecting nodes.

what u say??

 

Regards,

PD

Share this post


Link to post
Share on other sites

Hi Tinh

 

--first i find faces of selected compt then isolate it.
--create center at one side get that node id as ::node_1
--create center at other side get that node id as ::node_2
--get dist bet them and store in ::dist


# vector 

*vectorcreate_twonode $n1 $n2;
*vectordrawoptions size 1 0.1
*createmark vectors 1 -1;
set ::vectorCord [ hm_getmark vectors 1 ]


eval set baseNodeCoords [hm_nodevalue $::node_1]
set x [lindex $baseNodeCoords 0];
set y [lindex $baseNodeCoords 1];
set z [lindex $baseNodeCoords 2];

set i [ hm_getentityvalue vectors $::vectorCord "xcomp" 0 ];
set j [ hm_getentityvalue vectors $::vectorCord "ycomp" 0 ];
set k [ hm_getentityvalue vectors $::vectorCord "zcomp" 0 ];
*createmark nodes 1 "on plane" $x $y $z $i $j $k 0.1 1 0
set ::planeNodes [hm_getmark nodes 1]


# Translate node along created vector & mark nodes by plane there 
    
for {set trans 0.1} {$trans <= $::dist} {set trans [expr $trans + 0.1] } {
    *createmark nodes 2 $::node_1;
    *duplicatemark nodes 2 28;
    *createmark nodes 2 -1;
    *createvector 1 $i $j $k;
    *translatemark nodes 2 1 $trans;
    *createmark nodes 2 -1
    set trans_node [hm_getmark nodes 2];
    eval set baseNodeCoords [hm_nodevalue [hm_getmark nodes 2]];
    set x [lindex $baseNodeCoords 0];
    set y [lindex $baseNodeCoords 1];
    set z [lindex $baseNodeCoords 2];
    *createmark nodes 1 "on plane" $x $y $z $i $j $k 0.1 1 0
    eval lappend ::planeNodes [hm_getmark nodes 1];
    
    }
        
eval *createmark nodes 1 $::planeNodes;    
*findmark nodes 1 0 1 nodes 0 2

 

This code is selects all nodes in that plane but i want only internal nodes.

is there any API to do that.

Regards,

PD

 

Share this post


Link to post
Share on other sites

I have another idea, 

can you detect these 4 tip nodes by tcl script?

if you can, it is easy to create 4 feature edges => we can select internal nodes by 90D feature angle

axle_beam_3.thumb.PNG.e60b71fd6ab838af4fe2fd5f1df5ebfa.PNG.af5ea1d3db6cfe8b8e422a52f9bcd784.PNG

Share this post


Link to post
Share on other sites

I think we can detect the 4 nodes by using hm_getclosestnode

But first, we have to know position of your part relatively to origin (basic system XYZ)

example X is red and Y is green, take P1 and P2 are two positions very far from model

then the 4 tip nodes is:

set Node1 [hm_getclosestnode $P1x $P1y $P1z]

set Node2 ... ;#we have to choose appropriate P1 and P2 , maybe 4 positions are needed

axle_beam_2.thumb.PNG.02163c7165a25b77d5bd66ebbec94217.thumb.PNG.3ebfd7347baa466379906cf659fc9212.PNG

axle_beam_3.thumb.PNG.e60b71fd6ab838af4fe2fd5f1df5ebfa.PNG

Share this post


Link to post
Share on other sites

So assume that use will select 4 nodes by this order:

axle_beam_3.thumb.PNG.e60b71fd6ab838af4fe2fd5f1df5ebfa.PNG.bb0d16e969f6e30a9644a78171fc8b57.PNG

 

and we will store them as Node1 Node2 Node3 Node4

 

*createlistpanel nodes 1 "Select 4 nodes:"

set TipNodes [hm_getlist nodes 1]

if {[llength $TipNodes]!=4} return

lassign $TipNodes Node1 Node2 Node3 Node4

 

#Now try getting nodes on 4 edges:

*nodelistbypath $Node1 $Node2 1

set Edge12 [hm_getlist nodes 1]

*nodelistbypath $Node2 $Node3 1

set Edge23 [hm_getlist nodes 1]

*nodelistbypath $Node3 $Node4 1

set Edge34 [hm_getlist nodes 1]

*nodelistbypath $Node4 $Node1 1

set Edge41 [hm_getlist nodes 1]

Share this post


Link to post
Share on other sites

Try

eval *createlist nodes 1 $Edge12 

*features_add 1 0 0

eval *createlist nodes 1 $Edge23

*features_add 1 0 0

eval *createlist nodes 1 $Edge34 

*features_add 1 0 0

eval *createlist nodes 1 $Edge41 

*features_add 1 0 0

 

#now set a high feature angle to select all internal nodes:

*featureangleset 180

*createmark nodes 1 $FirstNode;

*appendmark nodes 1 "by face"

*featureangleset 30

set InternalNodes [hm_getmark nodes 1]

Share this post


Link to post
Share on other sites

Did you see yellow feature edges?

could you shift+F2 and select a node and select "by face", observe how the nodes are being selected?

adding feature edge will cause selection "by face" stopped at the feature

Share this post


Link to post
Share on other sites

Yes there are yellow feature edges.

i tried shift+F : but still it select all nodes

I think its becoz there are some hole in that part..

so do we need to add features edges around them as well? 

 

..........

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...