Jump to content

project nodes on nearest surface

Recommended Posts


the script is thought about long time ago

There are some ways but not actually efficient.

First i toggle all green lines to form 1 surf only => project easily, don't need script

But sometimes mess up the mesh!


Then i loop with each surf to project nodes on them. Mesh is not mess up

But script very slow because large number of small surfs


Then loop with each node to find closest surface, faster as surf list as shorter (appliable because we can limit surfs in a comp)


A script like this


Createmark surfs 1 all (or $slist , example: surfs in a comp => faster)

Foreach node $nlist (

   Createmark node 1 $node

   Lassign [hm_measureshortestdistance surfs 1 0 0 nodes 1 0 0] => closestSurf x y z

   Nodemodify $node $x $y $z



Then i ....

am thinking other ways because above one still too long (so usually, i let it run finally, overnight.





If you can divide a big model file to many files, each file has a few comps, above script will run much faster. And by dividing model you can run files on hm sessions simultenously.

Pandurang likes this

Share this post

Link to post
Share on other sites

1.Don't *createmark surfs 1 displayed  every loop !

2.Use *nodemodify is faster than *projectmark

3.Ignore associated nodes



*createmark elems 1 displayed

*findfaces elems 1

*createmark nodes 1 "by comp name" ^faces

*createmark surfs 1 displayed

*createmark nodes 2 "by surface on mark" 1

*markdifference nodes 1 nodes 2

set nd_list ...




=> i think much faster

Pandurang likes this

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.

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