Matlab补丁 - 带有颜色的3D打印格式

时间:2015-11-25 23:14:43

标签: matlab printing stl 3d

  

有没有人有过将Matlab彩色贴片输出到STL或其他可用于3D打印的格式的经验?

我有一个网格,其值与网格的每个点相关联。通过这种方式,我可以为表面着色并获得如下图所示的内容。我想尝试使用颜色打印与网格对应的彩色3D模型。但是,我没有设法使用Matlab文件交换中的任何可用工具来执行此操作。无论我做什么,我都无法获得文件中的颜色信息。

您对使用哪种格式存储网格以及附加到顶点的颜色以便3D打印机可以使用生成的文件有任何建议吗?

以下是我想要打印的对象示例:

enter image description here

1 个答案:

答案 0 :(得分:0)

看起来有时最好找到自己的解决方案。我找到的答案是使用obj。 obj格式非常简单,用一点字符串操作很容易编写文件。

点写在以v开头的行上。以下3项是点坐标,以下三项是RGB格式的颜色。面被写在以f开头的行上,后面是表示点索引的三个整数(大致是顶点所在的行的数量)。

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    if indexPath.row == 0 {
        //this is the indexPath row where we want our login cell to be showed
        let loginCell = tableView.dequeueReusableCellWithIdentifier("login", forIndexPath: indexPath) as! LoginTableViewCell
        //set the tag so when we select the cell we can see if the cell we have selected has a tag of 5
        loginCell.tag = 5
        return loginCell
    }else {
        //here goes our other cells, in this case they'll just be normal UITableViewCell
        let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath)
        return cell
    }
}

一旦你有一个有效的obj文件,你可以将它导入MeshLab(自由软件),然后将其导出为你喜欢的任何格式:stl,ply等。

相关问题