Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Does anyone have any good examples of how to use startTracking?
ry_gb
Member, csevp, pcbaevp Posts: 175 PRO
I've read a few posts on the forums, but would like to see some examples on how to use it. My dumb brain is failing to understand how to implement it in practice.
Ramon Yip | glassboard.com
Tagged:
0
Comments
It's not really a transparent example to browse but the way OnlyTabs handles the tab and slot generation is my most recent exploration so it's top of mind. It's a little hard to explain without visuals but I'll do my best.
The way the tab feature works in the standard library toolbox is it takes a surface body from a sketch, moves it to a sheet metal master surface location, does a thicken operation to create tool geometry, offsets all the faces of that tool by a clearance value specified by the user, does a subtraction of that clearance tool from the master surfaces of the sheet metal bodies in the subtraction scope, then the script unions the tab surface back to the master body after the clearances allow it to sit where it goes, creating a unified sheet for the update sheet metal engine to rebuild with no self intersections.
OnlyTabs pretty much copies this logic wholesale except without being limited to planar domains. I opSplit the input edge chain into domains where there are tabs or no tabs, copy the surfaces of the adjacent wall faces to this edge chain, do a surface extension operation to turn the segments into tab geometry on the surfaces, offset the tool surfaces to align them to the master surface definitions of the sheet metal parts, and do my thicken, subtraction, then union steps like default smTab does. There's a problem though in that if I did an offset to all of the thickened surfaces of my tool bodies I would delete the whole edge of the slot target instead of limiting the scope of my clearance operation just to the ends of the tabs like I wanted. I could try to query for some alignment but the better way is to just track the edges generated by that surface extension operation and resolve that tracking downstream after the thickening operation to find the surfaces resultant from that original extension. In this example the tracking query starts as an edge selection and when it's resolved later it's a face query resultant from those input edges.
In other examples of the code the tracking query is used to handle issues where split entities would result in ambiguity of execution or skipping entities I want to modify so I use a union query between the input and a tracked query of the input.
Derek Van Allen | Engineering Consultant | MeddlerI'll go take a look at the code and hopefully glean some insight. I'll let you know if I have more questions. Thanks for the detailed explanation!
Ramon Yip | glassboard.com