Jump to content
ChristopheThen

shells on interior solid faces

Recommended Posts

53 minutes ago, Sanjay Nainani said:

Hello,

 

To extract shells from 3D solid elements go to "Tools>>Faces". Here select the component and click "find faces". This will extract the 2D elements and place them in a new component.

 

Thankyou

 

Your method does NOT create interior solid faces.

Share this post


Link to post
Share on other sites

yes it does. you need to select "elements" from the drop down.

 

image.thumb.png.f0ce3ada57c9d614a403d5573b57e83a.png

 

 

Please refer the attached example:

This is a hollow cube tetra meshed.

image.thumb.png.57ce1a600ebb2eb1e07222ffb14063d6.png

 

 

when you use the suggested option it will extract 2D shell elements as shown below.

image.thumb.png.5ad12608789bae49b9358b828bba4f20.png

 

Thankyou 

Share this post


Link to post
Share on other sites

Mr Q.NGUYEN-DAI wants to say about interior faces, not boundary faces

I have a templex to generate it, tcl can do also but may be slow. I will share later

Ansa has this function but hm not yet

Mrt likes this

Share this post


Link to post
Share on other sites

Hi,

a script to create interior faces is like this:

You can save it to a file, then bind it with a user defined toolbar button, then just 1-click to get faces, not 2 !

proc ::p_CreateInteriorFaces args {
    if {[string match -nocase display* $args]} {
      *createmark elems 1 displayed
    } else {
	  *createmarkpanel elems 1 "Select 3d elems:"
    }
    if {[hm_marklength elems 1]==0} return
	*createmark elems 2 "by config" tetra4
	*markintersection elems 2 elems 1
	set Buf *ELEMENT_SHELL\n
	set i 0
	set ElemList {}
	if {[hm_marklength elems 2]} {
		eval lappend ElemList [hm_getmark elems 2]
		set ElemNodes [join [hm_getvalue elems mark=2 dataname=nodes]]
		foreach {n1 n2 n3 n4} $ElemNodes {
			append Buf "[incr i],CompId,$n1,$n2,$n3\n"
			append Buf "[incr i],CompId,$n1,$n2,$n4\n"
			append Buf "[incr i],CompId,$n2,$n3,$n4\n"
			append Buf "[incr i],CompId,$n3,$n1,$n4\n"
		}
	}
	*createmark elems 2 "by config" penta6
	*markintersection elems 2 elems 1
	if {[hm_marklength elems 2]} {
		eval lappend ElemList [hm_getmark elems 2]
		set ElemNodes [join [hm_getvalue elems mark=2 dataname=nodes]]
		foreach {n1 n2 n3 n4 n5 n6} $ElemNodes {
			append Buf "[incr i],CompId,$n1,$n2,$n3\n"
			append Buf "[incr i],CompId,$n4,$n5,$n6\n"
			append Buf "[incr i],CompId,$n1,$n2,$n5,$n4\n"
			append Buf "[incr i],CompId,$n2,$n3,$n6,$n5\n"
			append Buf "[incr i],CompId,$n3,$n1,$n4,$n6\n"
		}
	}
	*createmark elems 2 "by config" hex8
	*markintersection elems 2 elems 1
	if {[hm_marklength elems 2]} {
		eval lappend ElemList [hm_getmark elems 2]
		set ElemNodes [join [hm_getvalue elems mark=2 dataname=nodes]]
		foreach {n1 n2 n3 n4 n5 n6 n7 n8} $ElemNodes {
			append Buf "[incr i],CompId,$n1,$n2,$n3,$n4\n"
			append Buf "[incr i],CompId,$n5,$n6,$n7,$n8\n"
			append Buf "[incr i],CompId,$n1,$n2,$n6,$n5\n"
			append Buf "[incr i],CompId,$n2,$n3,$n7,$n6\n"
			append Buf "[incr i],CompId,$n3,$n4,$n8,$n7\n"
			append Buf "[incr i],CompId,$n4,$n1,$n5,$n8\n"
		}
	}
	if {$i} {
		eval *createmark elems 1 $ElemList
		*findfaces elems 1
		if {[hm_entityinfo exist comps ^interior_faces -byname]} {
			*createmark elems 1 "by comp name" ^interior_faces
			if {[hm_marklength elems 1]} {*deletemark elems 1}
		} else {
			*collectorcreateonly comps ^interior_faces "" 4
		}
		set Buf [string map [list CompId [hm_getentityvalue comps ^interior_faces id 0 -byname]] $Buf]
		set fpt [open interior_faces.k w]
		puts $fpt $Buf
		close $fpt
		*createstringarray 2 "LsDyna " "Keyword971 "
		*feinputwithdata2 "#ls-dyna\\dynakey" interior_faces.k 0 0 0 0 0 1 2 1 0
		*createmark elems 1 "by comp name" ^interior_faces
		*createmark elems 2
		*elementtestduplicates elems 1 2 2
		if {[hm_marklength elems 2]} {*deletemark elems 2}
		*createmark elems 1 "by comp name" ^interior_faces ^faces
		*createmark elems 2
		*elementtestconnectivity elems 1 2 2
		if {[hm_marklength elems 2]} {*deletemark elems 2}
		*facesdelete
	}
	*clearmarkall 1; *clearmarkall 2
}
#example: create interior faces for displayed 3d elems
::p_CreateInteriorFaces displayed

 

Mrt likes this

Share this post


Link to post
Share on other sites
5 hours ago, tinh said:

You can save it to a file, then bind it with a user defined toolbar button, then just 1-click to get faces, not 2 !

it was metaphor:D i have been using BETA CAE for a long time, i really like it.=) But in my new job i have HW products.)

But i will test your script later=)

thanks.)

tinh likes this

Share this post


Link to post
Share on other sites

hello, @tinh!

i have added your tool to user botton 

but i didn't choose elements. is it normaly?

and i want to ask you.

how to move this tools to user botton. it will be conveniently to work.)

when i work with mesh it's uncomfortable to switch between geom/2dmesh/tools.

thanks.

image.thumb.png.11fa7eeacbffd3f12cb9dfee0d822f99.pngimage.thumb.png.8f710d0f51b38b8fb2bf03067d451dcc.pngimage.thumb.png.4a13b1f0618cf45ee9b2a51d446af2a4.png

image.png

Share this post


Link to post
Share on other sites

Hi

Please remove "displayed" at the last line. Then it will prompt you to select elems

#example: create interior faces for  3d elems by user selection
::p_CreateInteriorFaces

Share this post


Link to post
Share on other sites
11 minutes ago, tinh said:

And to add the panels to user button,

 set command for the button as

hm_pushpanel "panel name"

 

Wow!

i'll try! it will be useful to me!

Share this post


Link to post
Share on other sites

i can add only tool from tcl scripts box.

but i can not add toolbox that contain all tools.

example.

i have added midmesh.tcl

but has added only midmesh create tool.

i haven't got editor and rebuild tool.=(

Share this post


Link to post
Share on other sites

 

Hi 

 

3D---> detach all elements (not detach from, simply detach) ---> take faces for detached elements, now give equivalence to all detached elements (shift +F3), now F10 ---> 2D --> Duplicates--> save failed

 

Create new collector in model browser --> organize all the saved elements in the new collector by using 'retrieve elements'

 

 

tinh likes this

Share this post


Link to post
Share on other sites
On 8/9/2018 at 10:51 AM, tinh said:

Hi,

a script to create interior faces is like this:

You can save it to a file, then bind it with a user defined toolbar button, then just 1-click to get faces, not 2 !


proc ::p_CreateInteriorFaces args {
    if {[string match -nocase display* $args]} {
      *createmark elems 1 displayed
    } else {
	  *createmarkpanel elems 1 "Select 3d elems:"
    }
    if {[hm_marklength elems 1]==0} return
	*createmark elems 2 "by config" tetra4
	*markintersection elems 2 elems 1
	set Buf *ELEMENT_SHELL\n
	set i 0
	set ElemList {}
	if {[hm_marklength elems 2]} {
		eval lappend ElemList [hm_getmark elems 2]
		set ElemNodes [join [hm_getvalue elems mark=2 dataname=nodes]]
		foreach {n1 n2 n3 n4} $ElemNodes {
			append Buf "[incr i],CompId,$n1,$n2,$n3\n"
			append Buf "[incr i],CompId,$n1,$n2,$n4\n"
			append Buf "[incr i],CompId,$n2,$n3,$n4\n"
			append Buf "[incr i],CompId,$n3,$n1,$n4\n"
		}
	}
	*createmark elems 2 "by config" penta6
	*markintersection elems 2 elems 1
	if {[hm_marklength elems 2]} {
		eval lappend ElemList [hm_getmark elems 2]
		set ElemNodes [join [hm_getvalue elems mark=2 dataname=nodes]]
		foreach {n1 n2 n3 n4 n5 n6} $ElemNodes {
			append Buf "[incr i],CompId,$n1,$n2,$n3\n"
			append Buf "[incr i],CompId,$n4,$n5,$n6\n"
			append Buf "[incr i],CompId,$n1,$n2,$n5,$n4\n"
			append Buf "[incr i],CompId,$n2,$n3,$n6,$n5\n"
			append Buf "[incr i],CompId,$n3,$n1,$n4,$n6\n"
		}
	}
	*createmark elems 2 "by config" hex8
	*markintersection elems 2 elems 1
	if {[hm_marklength elems 2]} {
		eval lappend ElemList [hm_getmark elems 2]
		set ElemNodes [join [hm_getvalue elems mark=2 dataname=nodes]]
		foreach {n1 n2 n3 n4 n5 n6 n7 n8} $ElemNodes {
			append Buf "[incr i],CompId,$n1,$n2,$n3,$n4\n"
			append Buf "[incr i],CompId,$n5,$n6,$n7,$n8\n"
			append Buf "[incr i],CompId,$n1,$n2,$n6,$n5\n"
			append Buf "[incr i],CompId,$n2,$n3,$n7,$n6\n"
			append Buf "[incr i],CompId,$n3,$n4,$n8,$n7\n"
			append Buf "[incr i],CompId,$n4,$n1,$n5,$n8\n"
		}
	}
	if {$i} {
		eval *createmark elems 1 $ElemList
		*findfaces elems 1
		if {[hm_entityinfo exist comps ^interior_faces -byname]} {
			*createmark elems 1 "by comp name" ^interior_faces
			if {[hm_marklength elems 1]} {*deletemark elems 1}
		} else {
			*collectorcreateonly comps ^interior_faces "" 4
		}
		set Buf [string map [list CompId [hm_getentityvalue comps ^interior_faces id 0 -byname]] $Buf]
		set fpt [open interior_faces.k w]
		puts $fpt $Buf
		close $fpt
		*createstringarray 2 "LsDyna " "Keyword971 "
		*feinputwithdata2 "#ls-dyna\\dynakey" interior_faces.k 0 0 0 0 0 1 2 1 0
		*createmark elems 1 "by comp name" ^interior_faces
		*createmark elems 2
		*elementtestduplicates elems 1 2 2
		if {[hm_marklength elems 2]} {*deletemark elems 2}
		*createmark elems 1 "by comp name" ^interior_faces ^faces
		*createmark elems 2
		*elementtestconnectivity elems 1 2 2
		if {[hm_marklength elems 2]} {*deletemark elems 2}
		*facesdelete
	}
	*clearmarkall 1; *clearmarkall 2
}
#example: create interior faces for displayed 3d elems
::p_CreateInteriorFaces displayed

 

Hi,

I am a new user in Hypermesh, and trying to learn how to extract shell from solid face. 

When I tried to add new user toolbar in Hypermesh 2019, there is no choice of "options" in toolbars. Could you please help me to address this problem and show me a better way to extract the shell from solid face in Hypermesh?

Many thanks!

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...