CreateM2D 生成1个2D的jpg文件并同时生成其网格

CreateM2D是1个终端使用工具,其设计用于生成1个2D的jpg文件并同时生成其网格。其需要使用如下的参数:

  • w:int 生成2D网格的网格尺寸width
  • h:int 生成2D网格的网格尺寸height
  • scale_ratio:float, 比例尺, 每个像素代表多少mm
  • img_filepath:生成网格图片jpg的地址
  • dirpath:网格存储文件夹地址
  • shape:(可选)str 网格名称

因此,使用CreateM2D的语法为:

1
CreateM2D w h scale_ratio img_filepath dirpath shape

或者:

1
CreateM2D w h scale_ratio img_filepath dirpath

例如,要在./Mesh/mesh.jpg路径生成1个宽300像素(网格)高100像素(网格)的网格,每个像素(网格)代表0.5mm,且希望生成的网格文件夹为./Data/Mesh/mesh-sample,则可使用:

1
./bin/CreateM2D.exe 300 100 0.5 ./Mesh/mesh.jpg ./Data/Mesh/mesh-sample

若要同时设定网格名称为hello-meshID/Shape=hello-mesh),则生成的命令为:

1
./bin/CreateM2D.exe 300 100 0.5 ./Mesh/mesh.jpg ./Data/Mesh/mesh-sample hello-mesh