In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces what is the difference between UFUN and NXOPEN transformation matrix. it is very detailed and has a certain reference value. Interested friends must read it!
The functions used for the entity transformation matrix in UFUN are:
UF_MODL_transform_entities
The classes used for assembly component transformation matrices in NXOPEN are:
ComponentNetwork
Their transformation matrix ways are different, the former is dynamic transformation, the latter is static transformation.
Dynamic transformation solution:
Var invert = Current.Inverse (); var trans = invert.Multiply (position)
Static transformation solution (rotate first and then translate):
Var cur = Current; cur.Transpose (); / / transpose var pos = position; pos.Transpose (); / / transpose var trans = cur.Inverse () .Multiply (pos); var rotation = trans.UpperLeft.ToMatrix3x3 (); trans.Transpose (); var translation = trans.Translation.ToVector3d ()
Share my two mobile-related classes (some related classes are not provided):
Public class MoveComponentBuilder {# region Constructors protected MoveComponentBuilder () {var workPart = theSession.Parts.Work; _ positioner = workPart.ComponentAssembly.Positioner; _ netWork = (ComponentNetwork) _ positioner.EstablishNetwork ();} public static MoveComponentBuilder Create (List components, Matrix44 matrix) {var mCompBuilder = new MoveComponentBuilder (); mCompBuilder.Current = matrix MCompBuilder.HomePosition = matrix; mCompBuilder.Components.AddRange (components); mCompBuilder._netWork.SetMovingGroup (components.ToArray ()); mCompBuilder._netWork.MoveObjectsState = true; return mCompBuilder;} public static MoveComponentBuilder Create (List components,SpecifyOrientation manip) {var mCompBuilder = Create (components, manip.GetPosition ()); mCompBuilder.Manip = manip Return mCompBuilder;} # endregion # region Fields private Positioner _ positioner; private ComponentNetwork _ netWork; private Session theSession = Session.GetSession (); # endregion # region Properties public Matrix44 Current {get; protected set;} public Matrix44 HomePosition {get; protected set;} public List Components {get; protected set;} = new List (); public SpecifyOrientation Manip {get Protected set;} # endregion # region Methods public void Move (Matrix44 position) {var cur = Current; cur.Transpose (); / / transpose var pos = position; pos.Transpose (); / / transpose var trans = cur.Inverse () .Multiply (pos); var rotation = trans.UpperLeft.ToMatrix3x3 () Trans.Transpose (); var translation = trans.Translation.ToVector3d (); _ netWork.BeginDrag (); _ netWork.DragByTransform (translation,rotation); _ netWork.EndDrag (); Current = position;} public void BackHome () {Move (HomePosition) } public bool Update () {if (Manip==null) {return false;} Move (Manip.GetPosition ()); return true;} public bool UpdateManipOnly () {if (Manip==null) {return false } Current = Manip.GetPosition (); return true;} public void Apply () {_ netWork.Solve () } # endregion} public class MoveObjectBuilder {# region Conductor protected MoveObjectBuilder () {} public static MoveObjectBuilder Create (List objs, Matrix44 matrix) {var mObj = new MoveObjectBuilder (); mObj.Current = matrix; mObj.HomePosition = matrix; mObj.Objects.AddRange (objs); return mObj } public static MoveObjectBuilder Create (List objs, SpecifyOrientation manip) {var mObj = Create (objs, manip.GetPosition ()); mObj.Manip = manip; return mObj;} # endregion # region Fields private static UFSession theUfSession = UFSession.GetUFSession (); private static Session theSession = Session.GetSession () # endregion # region Properties public List Objects {get; protected set;} = new List (); public Matrix44 Current {get; protected set;} public Matrix44 HomePosition {get; protected set;} public SpecifyOrientation Manip {get; protected set;} # endregion # region Methods public void Move (Matrix44 position) {var invert = Current.Inverse () Var trans = invert.Multiply (position); theUfSession.Modl.TransformEntities (Objects.Count, Objects.ToArray (), trans.ToArray ()); Current = position; theUfSession.Modl.Update ();} public void BackHome () {Move (HomePosition) } public bool Update () {if (Manip==null) {return false;} Move (Manip.GetPosition ()); return true;} public bool UpdateManipOnly () {if (Manip==null) {return false } Current = Manip.GetPosition (); return true;} # endregion}
Demo:
These are all the contents of the article "what are the differences between transformation matrices in UFUN and NXOPEN". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.