internal nodes selection
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.
Answers
-
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
0 -
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
0 -
Hi this api function can do it
Refer to it in hm reference help
0 -
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
<?xml version="1.0" encoding="UTF-8"?>
0 -
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
0 -
ok.
for time being lets focus on this model
is it possible for this model??
Regards,
PD
0 -
Of course it is possible. I just tell that script will not be able to work for every model
0 -
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
0 -
Please show your script codes
0 -
Hi,
I have not started yet/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />
Regards,
PD
0 -
Please start it up and show your codes
0 -
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 2This code is selects all nodes in that plane but i want only internal nodes.
is there any API to do that.
Regards,
PD
0 -
Can you select all internal nodes by feature angle?
Then you can use *markintersection to get nodes on plane and at internal side
0 -
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
0 -
Hi,
We can ask user to select these four tip nodes.
0 -
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
0 -
Altair Forum User said:
Hi,
We can ask user to select these four tip nodes.
OK ask user to select them is the simplest way
0 -
So assume that use will select 4 nodes by this order:
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]
0 -
Can you create 4 feature edges from above 4 nodelist?
0 -
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]
0 -
i tried...
but it select all nodes..
Regards,
PD
0 -
I just want to know...what is use of adding feature edges?/
Regards,
PD
0 -
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
0 -
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?
..........
0 -
Hi Tinh,
Thank you very very much for sharing your knowledge ,guidance, valuable time and quick replies/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />.
I tried creating feature edges at hole as well.
Now It work Perfectly.
I am able to see internal nodes get selected.
Now one thing is there any API to detect these hole in any part??
Once again Thanks Lot/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />
Regards,
PD
0 -
It's true. Because there are holes.
you have to add feature edge around holes, too
to fetch holes, use
0