Example #1
0
        public static FEMesh Transform(this FEMesh mesh, TransformMatrix transform, double tolerance = Tolerance.Distance)
        {
            if (!transform.IsRigidTransformation(tolerance))
            {
                BH.Engine.Reflection.Compute.RecordError("Transformation failed: only rigid body transformations are currently supported.");
                return(null);
            }

            FEMesh result = mesh.ShallowClone();

            result.Nodes = result.Nodes.Select(x => x.Transform(transform, tolerance)).ToList();

            List <Basis> orientationsBefore = mesh.LocalOrientations();

            result.Faces = new List <FEMeshFace>(mesh.Faces);
            for (int i = 0; i < orientationsBefore.Count; i++)
            {
                result.Faces[i] = result.Faces[i].SetLocalOrientation(result, orientationsBefore[i].Transform(transform).X);
            }

            return(result);
        }
Example #2
0
        /***************************************************/

        private static List <Basis> AllLocalOrientations(FEMesh element)
        {
            return(element.LocalOrientations());
        }