🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

project nodes on nearest surface

User: "Pandurang"
Altair Community Member
Updated by Pandurang

HI All,

 

i want to write script to project the face nodes on nearest surface..

is there any API?

any idea how to do this..

@tinh

 

 

Thanks

Find more posts tagged with

Sort by:
1 - 4 of 41
    User: "tinh"
    Altair Community Member
    Updated by tinh

    Hi

    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.

     

     

     

    Tips:

    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.

    User: "Pandurang"
    Altair Community Member
    OP
    Updated by Pandurang

    <?xml version="1.0" encoding="UTF-8"?>image.thumb.png.d67805ff2f9c76e446770752ef54d2b0.png

     

    I wrote this one...this also takes lot of time...

    @tinh

    User: "tinh"
    Altair Community Member
    Updated by tinh

    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

    User: "Pandurang"
    Altair Community Member
    OP
    Updated by Pandurang

    Thanks 

     

    This will be much better..