def Curve_Canvas_Init(self): self.__Canvas__=Canvas2(self.Min(),self.Max(),self.Resolution) #First the curve meshes self.Curve_Canvas_Init_Curves() #Then the functions self.Curve_Canvas_Init_Functions()
def Curve_Animation_Meshes(self, n): meshes = [ self.Rs, self.dRs_Num, self.d2Rs_Num, self.Ts_Num, self.Ns_Num, self.VNs_Num, self.RhoVs_Num, self.Evolutes_Num, self.dEvolutes_Num, ] pmin = self.Rs.Min(meshes) pmax = self.Rs.Max(meshes) self.Rs.__Canvas__ = Canvas2(pmin, pmax, self.Resolution) return meshes
def Mesh_SVG_Draw_With_Coordinate_System(self, svgfile, classs, color, resolution, curves=[]): fmin = self.Min() fmax = self.Max() curves.append(Mesh("X", [ [fmin[0], 0.0], [fmax[0], 0.0], ])) curves.append(Mesh("Y", [ [0.0, fmin[1]], [0.0, fmax[1]], ])) self.Mesh_SVG(Canvas2({}, [fmin, fmax], resolution), svgfile, classs, color)
def Curve_SVG_Write(self, meshes=[]): parms = {} canvas = Canvas2({}, [self.Curve_Min(), self.Curve_Max()], self.Resolution) name = "Curve" svgname = self.Curve_Parms_FileName(self.Name, name, "svg") paths = svgname.split('/') paths.pop() parmssvg = self.Curve_SVG_Parms_Text() color = "blue" self.R.Color = "blue" self.R.Mesh_SVG(canvas, svgname, name, "", parms, meshes, parmssvg) if (self.Evolute_Anal): name = "Analytical_Evolute" svgname = self.Curve_Parms_FileName(self.Name, name, "svg") color = "red" self.Evolute_Analytical.R.Mesh_SVG(canvas, svgname, name, color, parms, [self.R], parmssvg) if (self.Evolute_Numerical): name = "Numerical_Evolute" svgname = self.Curve_Parms_FileName(self.Name, name, "svg") color = "orange" self.Evolute_R.Mesh_SVG(canvas, svgname, name, color, parms, [self.R], parmssvg) if (self.Roulette): name = "Roulette" svgname = self.Curve_Parms_FileName(self.Name, name, "svg") color = "green" self.Roulette.R.Mesh_SVG(canvas, svgname, name, color, parms, [self.R], parmssvg)
def Init_Canvas(self, pmin=None, pmax=None, resolution=None): if (not pmin): pmin = self.PMin() if (not pmax): pmax = self.PMax() if (not resolution): resolution = self.Resolution self.Canvas = Canvas2(resolution, pmin, pmax)
def Mesh_Canvas_Init(self, resolution): if (resolution.__class__.__name__ == "Canvas2"): self.__Canvas__ = resolution else: self.__Canvas__ = Canvas2(self.Min(), self.Max(), resolution)
def Curve_Functions_Canvas(self, meshes): fmin, fmax = self.Curve_Functions_MaxMin(meshes) print "Curve_Functions_Canvas, Max/Min: ", fmin, ",", fmax return Canvas2(fmin, fmax, self.Resolution)
def Curve_Functions_Canvas_Init(self): pmin, pmax = self.Curve_Functions_Canvas_MaxMin() self.__Functions_Canvas__ = Canvas2(pmin, pmax, self.Resolution)