Create a wide using OnDraw in network nodes
Hi @Raviraj V, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.
If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.
Some trig will be involved for this and the commands you will need are drawtomodelscale() and either drawrect, drawrectangle or drawquad(). (fglRotate() might also help)
You'll also want the other node coordinates relative to the current node for a given port :
Vec3 otherloc = current.outObjects[port].location.project(current.outObjects[port].up,current);
and then the angle from one node to another will be
Math.degrees(Math.atan2(otherloc.y,otherloc.x))
If you were using an up to date version the vector logic is much simpler:
double pathwidth=2; drawtomodelscale(current); for (int n=current.outObjects.length;n>0;n--) { Vec3 otherloc = current.outObjects[n].location.project(current.outObjects[n].up,current); Vec2 other2=Vec2(otherloc.x,otherloc.y); Vec2 unit=other2/other2.magnitude*pathwidth/2; Vec2 leftoff=unit.rotate(90); Vec2 p1=leftoff; Vec2 p2=-leftoff; Vec2 p3=p2+other2; Vec2 p4=p3+leftoff*2; drawquad(view,p1.x,p1.y,0,p2.x,p2.y,0,p3.x,p3.y,0,p4.x,p4.y,0,0,1,0); }
8 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved