如何画一个真正的开瓶器

如何画一个真正的开瓶器

我想画一个像下图这样的真实螺丝。欢迎使用 tikz、asymptote 或 pstricks 中的任何代码!

螺丝1 为了不与我所链接的关于激光的问题相混淆(激光也是基于螺旋),我想补充一点:我确实需要螺旋形结构来预测稳定电流流过的直导体周围的磁场线的方向。

在此处输入图片描述在此处输入图片描述

我的尝试不符合现实 螺丝2

\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{fadings,decorations.pathmorphing,arrows.meta}
\begin{document}
\begin{tikzpicture}[line cap=round, line join=round]
\draw [line width=0.2mm,double=gray!70,decorate, decoration={zigzag,pre length=0.1cm,post
length=0.1cm,segment length=6},line join=round](0,-.75)  -> (1,-.75);
\draw [line width=0.1mm,double=gray!70,decorate, decoration={coil,pre length=0.1cm,post
length=0.1cm,segment length=2,amplitude=1mm},line join=round](0,-1.25)  ->   (1,-1.25); 
\draw [thick,double=gray!70,decorate, decoration={snake,pre length=0.1cm,post
length=0.1cm,segment length=6},line join=round](0,-1.75)  -> (1,-1.75);    
\end{tikzpicture}
\end{document}

或者可能使用 TikZ 再现螺旋图像

螺丝3 请问有什么想法吗?

答案1

在...的帮助下Asymptote 中的 stl 文件读取器渲染螺旋状物体的 stl 文件,你可以得到这个:

在此处输入图片描述

settings.outformat = "png";
settings.render = 8;
import three;
size(20cm);

struct stringpointer { string s; }

surface readstlfile(string filename, stringpointer returnsurfacename=null, bool ascii=true) {
  assert(ascii, "Reading binary stl files not implemented.");
  file stlfile = input(filename).word();  // Set up a file to read whitespace-delimited items.
  string nextword;
  real x, y, z;

  nextword = stlfile;  // Reading from a file is done by assignment in Asymptote.
  assert(nextword == "solid", filename + " is not a well-formed stl file.");

  string name = stlfile;
  if (returnsurfacename != null) returnsurfacename.s = name;

  surface toreturn;

  while (!eof(stlfile)) {
    nextword = stlfile;
    if (nextword == "endsolid") break;
    else if (nextword == "facet") {

      nextword = stlfile;
      assert(nextword == "normal");

      x = stlfile; y = stlfile; z = stlfile;
      triple normal = (x, y, z);

      nextword = stlfile; assert(nextword == "outer");
      nextword = stlfile; assert(nextword == "loop");
      triple[] vertices = new triple[3];
      for (int i = 0; i < 3; ++i) {
    nextword = stlfile; assert(nextword == "vertex");
    x = stlfile; y = stlfile; z = stlfile;
    vertices[i] = (x,y,z);
      }
      nextword = stlfile; assert(nextword == "endloop");
      nextword = stlfile; assert(nextword == "endfacet");

      patch triangle = patch(vertices[0] -- vertices[1] -- vertices[2] -- cycle);
      triangle.normals = array(4, value=normal);
      toreturn.s.push(triangle);

    } else assert(false, filename + " is not a well-formed stl file.");
  }
  assert(nextword == "endsolid", filename + " does not end correctly.");
  nextword = stlfile;
  assert(nextword == name, filename + " does not end with the solid's correct name " + name);
  return toreturn;
}

currentprojection = perspective(-30, 10, 60);
surface corkscrew = readstlfile("Corkscrew1.stl");
draw(corkscrew, blue);

相关内容