zoukankan      html  css  js  c++  java
  • 用脚本进行三维造型

    昨天有幸申请到AnyCAD Part Editor(一个脚本三维建模软件,官方介绍见此)的内部版本,使用了一下,感觉很小很强大。

    以下是使用手记。

    建立基本的三维基本体

    用它建立基本的三维基本体,如:

    圆柱

    topoShape = theBrepTools:MakeCylinder(Vector3(0,0,0), Vector3(0,0,1), 30, 50, 0)
    idx = theEntityGroup:AddTopoShape(topoShape)
    

      

    topoShape = theBrepTools:MakeSphere(Vector3(0,0,0), 100)
    idx = theEntityGroup:AddTopoShape(topoShape)
    

      

    长方体

    topoShape = theBrepTools:MakeBox(Vector3(0,0,0), Vector3(0,0,1), Vector3(50,50,80))
    idx = theEntityGroup:AddTopoShape(topoShape)

    圆台

    topoShape = theBrepTools:MakeCone(Vector3(0,0,0), Vector3(0,0,1), 100,50, 50,0)
    idx = theEntityGroup:AddTopoShape(topoShape)

    等等,还有其他。

    二维基本体

    -- Circle
    topoShape = theBrepTools:MakeCircle(Vector3(0,0,0), 100, Vector3(0,0,1))
    theEntityGroup:AddTopoShape(topoShape)
    -- Arc
    arc = theBrepTools:MakeArc(Vector3(-50,0,0), Vector3(0, 50,0), Vector3(0,0,0))
    theEntityGroup:AddTopoShape(arc)
    -- Spline
    pt1 = Vector3(0,0,0)
    pt2 = Vector3(50,0,0)
    pt3 = Vector3(100,30,0)
    pt4 = Vector3(150,100,0)
    pts = Vector3List()
    pts:Add(pt1)
    pts:Add(pt2)
    pts:Add(pt3)
    pts:Add(pt4)
    spline = theBrepTools:MakeSpline(pts)
    theEntityGroup:AddTopoShape(spline)

    三维特征操作

    拉伸

    arc = theBrepTools:MakeArc(Vector3(-50,0,0), Vector3(0, 50,0), Vector3(0,0,0))
    extrude = theBrepTools:Extrude(arc, 100, Vector3(0,0,1))
    idx = theEntityGroup:AddTopoShape(extrude)
    

      

    扫略

    -- Section
    circle = theBrepTools:MakeCircle(Vector3(0,0,0), 10, Vector3(1,0,0))
    edgeGroup = TopoShapeGroup()
    edgeGroup:Add(circle)
    wire = theBrepTools:MakeWire(edgeGroup)
    -- Path
    pt1 = Vector3(0,0,0)
    pt2 = Vector3(50,0,0)
    pt3 = Vector3(100,30,0)
    pt4 = Vector3(150,100,0)
    pts = Vector3List()
    pts:Add(pt1)
    pts:Add(pt2)
    pts:Add(pt3)
    pts:Add(pt4)
    spline = theBrepTools:MakeSpline(pts)
    sweep = theBrepTools:Sweep(wire, spline)
    theEntityGroup:AddTopoShape(sweep)
    

      

    回转体

    arc = theBrepTools:MakeArc(Vector3(-50,0,0), Vector3(0, 50,0), Vector3(0,0,0))
    revol = theBrepTools:Revol(arc, Vector3(0,0,0), Vector3(1,0,1), 300)
    theEntityGroup:AddTopoShape(revol)
    

      

    其他等等...

    文件导出

    这个软件支持把建立好的模型导出为STL,IGES,STEP,因而可以在SolidWorks,UG里面打开了。

    总结

    上手有点难度,但掌握了就很好用。

    PS:需要的留下email

  • 相关阅读:
    FSR薄膜压力传感器使用教程
    3.7 基于51单片机+MC20的路径显示【使用STC15W内核】
    4.6 基于STM32+MC20地图显示路径功能
    ProgressDialog 进度条的初步认识
    初识别进度条
    Spinner simpleAdapte适配器 下拉列表
    下拉菜单 Spinner 简单纯字符串版
    onItemSelected 获取选中的 信息 3种方法
    GridView 二维排布
    datePicker 及 timePicker Diolage弹出对话框式 比较好看的 监听事件
  • 原文地址:https://www.cnblogs.com/drwangx/p/script-modeling-tool.html
Copyright © 2011-2022 走看看