Eda Begum Birol ebb75
PHASE 1: INPUT MESH
PHASE 0 : INPUT MESH
PHASE 0: OUTPUT MESH
PHASE 1 : BRIDGE IDENTIFICATION AND ENHANCEMENT
PHASE 0 : HOLLOW GEOMETRY private void RunScript(Mesh m, double cap_remove_tolerence, ref object Hollowed_Mesh) {
private void RunScript(Mesh m, double bridge_offset, double detection_range, double detection_height_min, double detection_height_max, ref object Bridge_ Enhancement) {
List < Point3d > vertice = new List < Point3d >(); List < Vector3d > verticenormal = new List < Vector3d >();
for(int i = 0; i < m.Vertices.Count; ++i) { Point3d vx = m.Vertices[i]; Vector3d n = m.Normals[i];
for(int i = 0; i < m.Vertices.Count; ++i) { vertice.Add(m.Vertices[i]); verticenormal.Add(m.Normals[i]); }
double bridge_angle = Math.Abs(n.Z);
m.Faces.ConvertQuadsToTriangles();
ELEVATION
if (bridge_angle > detection_range && m.Vertices[i].Z < detection_height_max && m.Vertices[i].Z > detection_height_min ){ m.VertexColors.SetColor(i, 14, 77, 146); vx += n * (bridge_offset * bridge_angle); // offset point vx along the normal n
List < Point3d > centroids = new List < Point3d >(); List < Vector3d > areanormals = new List < Vector3d >(); List < double > areas = new List < double >(); List<int> facesToRemove = new List<int>(); double totalArea = 0.0; for(int j Point3d Point3d Point3d
= a b c
m.Vertices.SetVertex(i, vx); //set the vertex i to the newly displaced point vx
0; j < m.Faces.Count; ++j) { = m.Vertices[m.Faces[j].A]; = m.Vertices[m.Faces[j].B]; = m.Vertices[m.Faces[j].C];
}
centroids.Add((a + b + c) * (1.0 / 3.0));
}
Vector3d ab = b - a; Vector3d ac = c - a; Vector3d n = Vector3d.CrossProduct(ab, ac);
else{ m.VertexColors.SetColor(i, 202, 204, 206);}
m.FaceNormals.ComputeFaceNormals(); m.Normals.ComputeNormals();
double faceArea = n.Length * 0.5; n.Unitize();
Bridge_Enhancement = m;
totalArea += faceArea;
TOP VIEW
areas.Add(faceArea); areanormals.Add(n); double remove_surface_angle = Math.Abs(n.Z); if (Math.Abs(remove_surface_angle - 1) < cap_remove_ tolerence){ facesToRemove.Add(j); } } m.Faces.DeleteFaces(facesToRemove); Hollowed_Mesh = m;
AXONOMETRIC BRIDGE IDENTIFICATION
A: SHAPE MODIFIER
BRIDGE ENHANCEMENT WITH BRIDGE_OFFSET FACTOR 3
BRIDGE ENHANCEMENT WITH BRIDGE_OFFSET FACTOR 6
PHASE 0 &1 : LOGIC I took advantage of this assignment to aid my current research concerning the clay extrusion based fabrication of 3D lattices. The first pages of this submission demonstrate my transformation logics in a simpler geomery of a sphere, which are later applied to a spatial lattice. Phase 0 and 1 are preliminary print preperation steps: namely the hollowing of the print object and the local thickening of the bridge areas. These steps are described individually below.
Phase 0: Hollowing Inputs: - Mesh - Tolerence (Deviation from (normal.Z - 1) which, in a case of perfect horizontality would result in zero. Outputs: - Hollowed Mesh
ORIGINAL
This is a print preparation phase mainly in response to the tooplathing of the Potterbot printers. The lattices I generate are within a cubic bounding box and have top and bottom caps. However in this phase of prototyping I am prototyping these lattices hollow while thinking about internal filling patterning and various approaches to internal support structures. Thus, in the first step, I implement a code that checks for the angle of each mesh face to the ground plane, and if this angle indicates perfect horizontality, the face is removed. This, for my spatial lattice prototypes aims to remove the perfectly horizontal top and bottom cap, but not the bridge areas.
Phase 1: Bridge Enhancement The areas of bridging are defined by a small angle between the vertex normal and the Z direction of the world plane. I target these areas for a local thickening process mainly in response to various print observations including low resolution, looping, and failure in bridging areas during the print process. The input is the hollowed mesh resulting from the Phase 0 operation. This bridge_offset, namely the amount of thickening, and the detection_range, namely the maximum angle between the vertex normal and the world z axis is also user input. Additionally the user can define a detection minimum and maximum height in order to avoid bridge identification of lowest points that are being supported by the printbed etc.
Inputs: -
HOLLOWING & BRIDGE ENHANCEMENT
Hollowed Mesh Bridge Offset Detection Range Detection Height (min) Detection Height (mzx)
Outputs:
A: SHAPE MODIFIER
- Mesh with (Colorized) and Enhanced Bridging Areas
PHASE 2: IDENTIFYING AND ISOLATING “SUPPORT” AREAS PHASE 2 : LOGIC
PHASE 2 : CODE
In this phase of the script, I wanted to identify a smaller bottom portion within the bridge locations that required most support and isolate this as a seperate mesh. I imagined this seperate mesh would serve as an input for the final step of mesh addition, where I wanted to specifically target bottom bridge areas with most horizontality and support them with added meshes. Thus, this portion of the script has the mesh input with enhanced bridges (as output by the phase 1 component). At this point, one can deterine a more narrow detection range than phase one. Tolerence range and detection_height minimum are also user input.
private void RunScript(Mesh m, double detection_range, double tolerence_range, double detection_height_min, ref object SupportArea, ref object Support_Mesh) {
The script seperates the mesh into 2 seperate meshes in that it removes the area that needs to be supported from the input mesh, and recreates it as a seperate “support” mesh that then can be input into the final component to create the support structures.
List<int> facesToRemove2 = new List<int>(); List <int> supportMesh = new List <int> (); List < Point3d > centroids = new List < Point3d >(); List < Vector3d > areanormals = new List < Vector3d >(); List < double > areas = new List < double >(); List < double > bottom_bridge_angles = new List < double >(); Mesh support = new Mesh ();
nputs: -
PHASE 2A: IDENTIFY SUPPORT AREA SUPPORT MESH
Mesh with Detection Tolerence Detection
(Colorized) and Enhanced Bridging Areas Range Range Height Min
Outputs: - Support Area Remaining area with the support mesh removed - Support Mesh Mesh faces that are within the tolerence range and need to be supported.
MESH WITH SUPPORT AREA MESH SUBSTRACTED
PHASE 2B: ISOLATE SUPPORT AREA
SUPPORT MESH ISOLATED AS FURTHER INPUT
{
for(int j = 0; j < m.Faces.Count; j++) Point3d a = m.Vertices[m.Faces[j].A]; Point3d b = m.Vertices[m.Faces[j].B]; Point3d c = m.Vertices[m.Faces[j].C]; centroids.Add((a + b + c) * (1.0 /
3.0));
Vector3d ab = b - a; Vector3d ac = c - a; Vector3d n = Vector3d. CrossProduct(ab, ac); n.Unitize(); double bottom = n.Z; //List that contains all angles calculated bottom_bridge_angles.Add(bottom); if (bottom > ((bottom_bridge_angles. Min()) - tolerence_range) && bottom < ((bottom_bridge_angles.Min()) + tolerence_ range) && Math.Abs(bottom) > detection_ range && m.Vertices[m.Faces[j].A].Z < detection_height_min){ support.Vertices.Add(a); support.Vertices.Add(b); support.Vertices.Add(c); facesToRemove2.Add(j); supportMesh.Add(j); } } for (int j = 0; j < support.Vertices. Count - 2; j += 3){ support.Faces.AddFace(j, j + 1, j + 2); }
B: FACE CULLING/DELETION SCHEME
PHASE 3: GENERATING THE SUPPORT STRUCTURE
PHASE 3 : CODE List <Mesh> output_meshes1 = new List <Mesh>(); List <Mesh> output_meshes2 = new List <Mesh>();
At this phase, I use the previous output of support mesh as an input. I find the center point of each mesh face that needs to be supported, and build a pyramid meeting this point. The height of the pyramid can be controlled with the offset input. Then, I project the base of the triangle vertically downwards to meet the print bed. The resulting structure serves as a support structure that can be easily broken off because it tapers to a point. However, in further imoproving this code, I would like to consider potentially non-triangular geometries and scale up the meeting point to accomodate the print nozzle size.
for (int fi = 0; fi < m.Faces.Count; fi += 2){ // identifying indexes of the 3 points that make up the
vertex
int v1 = m.Faces[fi].A; int v2 = m.Faces[fi].B; int v3 = m.Faces[fi].C; //identifying the coordinates of the point Point3d p1 = m.Vertices[v1]; Point3d p2 = m.Vertices[v2]; Point3d p3 = m.Vertices[v3];
Inputs: - Mesh Support Area - Pyramid Height (Offset)
// finding the centroid of the 3 points // mean location in the cloud of points, so found by adding all the point coordinates together and dividing it by the number of points Point3d cen = (p1 + p2 + p3) / 3;
Outputs:
//Normal //Vector3d fn = m.FaceNormals[fi]; // Calculation of the normal : however this is not always automatically calculated Vector3d fn = Vector3d.CrossProduct(p2 - p1, p3 - p1); // cross product of two edges --> edges found by substracting the 2 points from eachother double area = fn.Length * 0.5; fn.Unitize();
- Pyramid Connection to Print Geometry - Vertical Extrusion to Meet Printbed
Mesh m2 = new Mesh(); Vector3d z = new Vector3d(); z.X = 0; z.Y = 0; z.Z = -1; Point3d op1 = p1 + (z * (offset)); Point3d op2 = p2 + (z * (offset)); Point3d op3 = p3 + (z * (offset)); m2.Vertices.Add(op1); m2.Vertices.Add(op2); m2.Vertices.Add(op3); m2.Vertices.Add(cen); m2.Faces.AddFace(0, m2.Faces.AddFace(0, m2.Faces.AddFace(1, m2.Faces.AddFace(0,
//0’ //1’ // 2’ // 3
1, 2, 2, 1,
2); 3); 3); 3);
m2.FaceNormals.ComputeFaceNormals(); m2.Normals.ComputeNormals(); output_meshes1.Add(m2); Mesh m3 = new Mesh (); Point3d bp1 = new Point3d(op1.X, op1.Y, -150); Point3d bp2 = new Point3d(op2.X, op2.Y, -150); Point3d bp3 = new Point3d(op3.X, op3.Y, -150); m3.Vertices.Add(op1); m3.Vertices.Add(op2); m3.Vertices.Add(op3); m3.Vertices.Add(bp1); m3.Vertices.Add(bp2); m3.Vertices.Add(bp3); m3.Faces.AddFace(4, m3.Faces.AddFace(4, m3.Faces.AddFace(3, m3.Faces.AddFace(3, m3.Faces.AddFace(5, m3.Faces.AddFace(5, m3.Faces.AddFace(3,
//0 //1 // 2 // 3 // 4 // 5
2, 1, 1, 0, 0, 2, 4,
5); 2); 4); 1); 3); 0); 5);
m3.FaceNormals.ComputeFaceNormals(); m3.Normals.ComputeNormals();
SUPPORT MESH
PYRAMID SUPPORTS
PYRAMID SUPPORTS (JUST SUPPORTS VIEW)
ENTIRE PRINT SUPPORT STRUCTURE
output_meshes2.Add(m3); } ConnectionSupport = output_meshes1; PrintbedSupport = output_meshes2;
C: FACE CREATION SCHEME
FINAL PRODUCT
PHASE 0 OUTPUT: HOLLOWED
FINAL OUTPUT TOP VIEW
PHASE 1 OUTPUT: THICKENED
FINAL OUTPUT AXONOMETRIC VIEW
PHASE 2 OUTPUT: SUPPORT AREA IDENTIFIED
FINAL OUTPUT WORM’S EYE AXONOMETRIC VIEW
PHASE 3: 2 TYPES OF COMPLEMENTARY SUPPORT STRUCTURES GENERATED
FINAL OUTPUT ELEVATION VIEW
Note: this is a non-chronological representation of the final product, in which i highlight what phases have created the transformation visible in the various views of the final product
CUSTOM PRINT PREPERATION COMPONENT: APPLIED
Bridge Identification
In printing 3D lattices, I came to realize that the briging areas had issues of looping and low resolution. I wanted to address this through this assignment.
Bridge Thickening
Support Generation
In this iteration of printing, i will test print the modified mesh and record if some of the identified issues have been solved. I will input the observations and continue to improved the script to respond to material and scale based paramateres as well.
COMBINED RESULT (b.a.)
CUSTOM PRINT PREPERATION COMPONENT: APPLIED
A: SHAPE MODIFIER
B: FACE CULLING/DELETION SCHEME
C: FACE CREATION SCHEME
FINAL DESIGN