简体   繁体   English

将 SVG 文件带入 Openscad 的问题

[英]Issue bringing SVG file into Openscad

I am using the following Code to turn a somewhat complicated SVG file into a 3D plate for the letterpress printing process.我正在使用以下代码将有点复杂的 SVG 文件转换为 3D 凸版印刷过程的印版。 I get a mesh error when I can find no issues within the SVG itself.当我在 SVG 本身中找不到任何问题时,我收到了网格错误。 All of the paths are closed.所有的路径都关闭了。

I added the Offset(delta=0.001) and that seemed to help on simple SVG's with simple shapes or a small amount of text.我添加了 Offset(delta=0.001),这似乎有助于处理具有简单形状或少量文本的简单 SVG。 But I have been processing the SVG that I am attaching here for over 12 hours and it seems to be stuck somewhere.但是我已经处理了我附加在这里的 SVG 超过 12 个小时,它似乎卡在了某个地方。 (Screenshot Attached) (附截图)

scad screenshot截图

file = "InviteFinal.svg";
width = 139.7;
height = 215.9;

feature_height = 1.143;
plate_thickness = 0.254;

union()
{
    minkowski()
    {
        linear_extrude(height = 0.1, center = false, convexity = 10)
        scale([-1, 1, 1])
        translate([-width, 0, 0])
        offset(delta=0.001)
        import(file);
        
        
        cylinder(feature_height - 0, 0.25, 0);
    }
    
    translate([-10,-10,-0.254])
    cube([width+20,height+20,plate_thickness]);

    minkowski()
    {
        union()
        {
            translate([width+5,height,0])
            cube([5,0.8,0.2],true);

            translate([width,height+5,0])
            cube([0.8,5,0.2], true);


            translate([-5,0,0])
            cube([5,0.8,0.2],true);

            translate([0,-5,0])
            cube([0.8,5,0.2], true);


            translate([width+5,0,0])
            cube([5,0.8,0.2],true);

            translate([width,-5,0])
            cube([0.8,5,0.2], true);


            translate([-5,height,0])
            cube([5,0.8,0.2],true);

            translate([0,height+5,0])
            cube([0.8,5,0.2], true);
        }
        
        cylinder(feature_height - 0.1, 0.2, 0);
    }
}

SVG file SVG 文件

The problem is the first minkowski() sum on the extruded text and the cylinder.问题是挤压文本和圆柱体上的第一个 minkowski() 总和。 The purpose of doing a minkowski() sum is to round the corners on objects.进行 minkowski() 求和的目的是使对象的角变圆。 The more corners there are the longer it takes.弯道越多,所需时间越长。 So for things like the letter 'O' it will take a long time.所以对于像字母“O”这样的事情,需要很长时间。

From the OpenSCAD documentation for minkowski :来自 minkowski 的OpenSCAD文档:

Warning: for high values of $fn the minkowski sum may end up consuming lots of CPU and memory, since it has to combine every child node of each element with all the nodes of each other element.警告:对于 $fn 的高值,minkowski 和最终可能会消耗大量 CPU 和 memory,因为它必须将每个元素的每个子节点与每个其他元素的所有节点组合起来。 So if for example $fn=100 and you combine two cylinders, then it does not just perform 200 operations as with two independent cylinders, but 100*100 = 10000 operations.因此,如果例如 $fn=100 并且您组合了两个圆柱体,那么它不会像两个独立的圆柱体那样仅执行 200 次操作,而是执行 100*100 = 10000 次操作。

To troubleshoot I removed the second half of the file from the second minkowski sum on down.为了解决问题,我从第二个 minkowski 和中删除了文件的后半部分。 That locked up OpenSCAD and I had to close it.那锁定了 OpenSCAD,我不得不关闭它。 When I removed the first minkowski() sum so that just the svg was extruded it rendered in 5 seconds.当我删除第一个 minkowski() 总和以便只有 svg 被挤出时,它在 5 秒内呈现。 What effect are you trying to achieve by doing a minkowski sum on the svg?你想通过对 svg 进行闵可夫斯基求和来达到什么效果?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM