public void Create(float spokeLen, float spokeRad, float centerRad, float arrowLen, float arrowRad) { float ang90 = (float)(Math.PI / 2.0); Cylinder3d cn; axisInd = new List <Object3d>(); // x arrow cn = new Cylinder3d(); cn.Create(arrowRad, 0.0f, arrowLen, 8, 2); cn.SetColor(Color.Red); cn.Rotate(0, ang90, 0); cn.Translate(spokeLen + arrowLen / 2 - 0.1f, 0, -arrowLen / 2); axisInd.Add(cn); cn = new Cylinder3d(); cn.Create(spokeRad, spokeRad, spokeLen, 8, 2); cn.Rotate(0, ang90, 0); cn.Translate(spokeLen / 2, 0, -spokeLen / 2); cn.SetColor(Color.Red); axisInd.Add(cn); // y arrow cn = new Cylinder3d(); cn.Create(arrowRad, 0.0f, arrowLen, 8, 2); cn.SetColor(Color.Green); cn.Rotate(-ang90, 0, 0); cn.Translate(0, spokeLen + arrowLen / 2 - 0.1f, -arrowLen / 2); axisInd.Add(cn); cn = new Cylinder3d(); cn.Create(spokeRad, spokeRad, spokeLen, 8, 2); cn.Rotate(-ang90, 0, 0); cn.Translate(0, spokeLen / 2, -spokeLen / 2); cn.SetColor(Color.Green); axisInd.Add(cn); // z arrow cn = new Cylinder3d(); cn.Create(arrowRad, 0.0f, arrowLen, 8, 2); cn.SetColor(Color.Blue); cn.Translate(0, 0, spokeLen); axisInd.Add(cn); cn = new Cylinder3d(); cn.Create(spokeRad, spokeRad, spokeLen, 8, 2); cn.SetColor(Color.Blue); axisInd.Add(cn); // center //Object3d sp = Primitives.Sphere(centerRad, 7, 8); //sp.SetColor(Color.Yellow); //axisInd.Add(sp); float r = centerRad; axisCent = Quad3d.CreateQuadBox(-r, r, -r, r, -r, r); axisCent[0].imgname = "axisx"; axisCent[1].imgname = "axisx"; axisCent[2].imgname = "axisy"; axisCent[3].imgname = "axisy"; axisCent[4].imgname = "axisz"; axisCent[5].imgname = "axisz"; }
void AddPlatWalls() { float platX, platY, platZ; platX = (float)UVDLPApp.Instance().m_printerinfo.m_PlatXSize / 2; platY = (float)UVDLPApp.Instance().m_printerinfo.m_PlatYSize / 2; platZ = (float)UVDLPApp.Instance().m_printerinfo.m_PlatZSize; m_walls = Quad3d.CreateQuadBox(-platX, platX, -platY, platY, 0, platZ, "WarnWall"); }
public static List<Quad3d> CreateQuadBox(float x1, float x2, float y1, float y2, float z1, float z2, string image = null) { Quad3d q; List<Quad3d> qlist = new List<Quad3d>(); // right wall q = new Quad3d(image); q.SetPoint(0, x2, y2, z2); q.SetPoint(1, x2, y1, z2); q.SetPoint(2, x2, y1, z1); q.SetPoint(3, x2, y2, z1); qlist.Add(q); // left wall q = new Quad3d(image); q.SetPoint(0, x1, y1, z2); q.SetPoint(1, x1, y2, z2); q.SetPoint(2, x1, y2, z1); q.SetPoint(3, x1, y1, z1); qlist.Add(q); // front wall q = new Quad3d(image); q.SetPoint(0, x2, y1, z2); q.SetPoint(1, x1, y1, z2); q.SetPoint(2, x1, y1, z1); q.SetPoint(3, x2, y1, z1); qlist.Add(q); // back wall q = new Quad3d(image); q.SetPoint(0, x1, y2, z2); q.SetPoint(1, x2, y2, z2); q.SetPoint(2, x2, y2, z1); q.SetPoint(3, x1, y2, z1); qlist.Add(q); // top wall q = new Quad3d(image); q.SetPoint(0, x2, y2, z2); q.SetPoint(1, x1, y2, z2); q.SetPoint(2, x1, y1, z2); q.SetPoint(3, x2, y1, z2); qlist.Add(q); // bottom wall q = new Quad3d(image); q.SetPoint(0, x2, y1, z1); q.SetPoint(1, x1, y1, z1); q.SetPoint(2, x1, y2, z1); q.SetPoint(3, x2, y2, z1); qlist.Add(q); return qlist; }
public static List <Quad3d> CreateQuadBox(float x1, float x2, float y1, float y2, float z1, float z2, string image = null) { Quad3d q; List <Quad3d> qlist = new List <Quad3d>(); // right wall q = new Quad3d(image); q.SetPoint(0, x2, y2, z2); q.SetPoint(1, x2, y1, z2); q.SetPoint(2, x2, y1, z1); q.SetPoint(3, x2, y2, z1); qlist.Add(q); // left wall q = new Quad3d(image); q.SetPoint(0, x1, y1, z2); q.SetPoint(1, x1, y2, z2); q.SetPoint(2, x1, y2, z1); q.SetPoint(3, x1, y1, z1); qlist.Add(q); // front wall q = new Quad3d(image); q.SetPoint(0, x2, y1, z2); q.SetPoint(1, x1, y1, z2); q.SetPoint(2, x1, y1, z1); q.SetPoint(3, x2, y1, z1); qlist.Add(q); // back wall q = new Quad3d(image); q.SetPoint(0, x1, y2, z2); q.SetPoint(1, x2, y2, z2); q.SetPoint(2, x2, y2, z1); q.SetPoint(3, x1, y2, z1); qlist.Add(q); // top wall q = new Quad3d(image); q.SetPoint(0, x2, y2, z2); q.SetPoint(1, x1, y2, z2); q.SetPoint(2, x1, y1, z2); q.SetPoint(3, x2, y1, z2); qlist.Add(q); // bottom wall q = new Quad3d(image); q.SetPoint(0, x2, y1, z1); q.SetPoint(1, x1, y1, z1); q.SetPoint(2, x1, y2, z1); q.SetPoint(3, x2, y2, z1); qlist.Add(q); return(qlist); }