Commits

Lars Brubaker committed 8c21a05

Made vector able to take per element formating in tostring.
made the scad output only push 7 decimals into the matrix output.

Comments (0)

Files changed (2)

Csg/Processors/OpenSCadOutput.cs

         public string GetScadOutputRecursive(TransformBase objectToProcess, int level = 0)
         {
             return ApplyIndent(AddRenderInfoIfReqired(objectToProcess) + "multmatrix(m = [ ["
-                + objectToProcess.transform.Column0.ToString() + "],["
-                + objectToProcess.transform.Column1.ToString() + "],["
-                + objectToProcess.transform.Column2.ToString() + "],["
-                + objectToProcess.transform.Column3.ToString() + "] ])" + AddNameAsComment(objectToProcess) + "\n{\n" + GetScadOutputRecursive((dynamic)objectToProcess.objectToTransform, level + 1) + "\n}", level);
+                + objectToProcess.transform.Column0.ToString("0.#######") + "],["
+                + objectToProcess.transform.Column1.ToString("0.#######") + "],["
+                + objectToProcess.transform.Column2.ToString("0.#######") + "],["
+                + objectToProcess.transform.Column3.ToString("0.#######") + "] ])" + AddNameAsComment(objectToProcess) + "\n{\n" + GetScadOutputRecursive((dynamic)objectToProcess.objectToTransform, level + 1) + "\n}", level);
         }
         #endregion
 

VectorMath/Vector4.cs

             return String.Format("{0}, {1}, {2}, {3}", x, y, z, w);
         }
 
+        /// <summary>
+        /// Returns a System.String that represents the current Vector4d, formatting each element with format.
+        /// </summary>
+        /// <param name="format"></param>
+        /// <returns></returns>
+        public string ToString(string format = "")
+        {
+            return x.ToString(format) + ", " + y.ToString(format) + ", " + z.ToString(format) + ", " + w.ToString(format);
+        }
+
         #endregion
 
         #region public override int GetHashCode()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.