当前位置: 首页 > news >正文

天津实用网站建设黑龙江专业网站建设

天津实用网站建设,黑龙江专业网站建设,网站制作费用要多少钱,网站到期了简介 FreeCAD是一款强大的开源CAD软件#xff0c;可以与python无缝对解#xff0c;使用python来驱动三维几何的构建#xff0c;具有很高的灵活性。本文主要讨论一下录制宏的方法#xff0c;以及如何驱动特定参数 方法 打开FreeCAD软件#xff0c;点击录制宏按钮后…简介 FreeCAD是一款强大的开源CAD软件可以与python无缝对解使用python来驱动三维几何的构建具有很高的灵活性。本文主要讨论一下录制宏的方法以及如何驱动特定参数 方法 打开FreeCAD软件点击录制宏按钮后建立如下简单的三维模型 模型建好之后结束宏录制可以得到一段python代码 阅读代码不难理解何处对哪些尺寸进行了赋值。所以只需要将这些“尺寸数值”用python变量替代即可实现参数化驱动。 以下代码利用python的random库将圆柱半径、长度、矩形孔宽度和高度设置为随机数并把生成的几何保存为webGL格式 # -*- coding: utf-8 -*-# Macro Begin: /home/liwentao/.local/share/FreeCAD/Macro/myRandomCoin.FCMacro import FreeCAD import PartDesign import PartDesignGui import Sketcher import randomR random.uniform(20, 40) Lrandom.uniform(50, 200) DXrandom.uniform(5, 15) DYrandom.uniform(5, 15)### Begin command Std_Delete if App.getDocument(Unnamed).getObject(Body) is not None:App.getDocument(Unnamed).getObject(Body).removeObjectsFromDocument()App.getDocument(Unnamed).removeObject(Body)App.getDocument(Unnamed).recompute() ### End command Std_Delete### Begin command PartDesign_Body App.activeDocument().addObject(PartDesign::Body,Body) App.ActiveDocument.getObject(Body).Label 实体 App.ActiveDocument.recompute() ### End command PartDesign_Body # Gui.Selection.addSelection(Unnamed,Body) # Gui.Selection.clearSelection() # Gui.Selection.addSelection(Unnamed,Body,Origin.XY_Plane.) App.getDocument(Unnamed).getObject(Body).newObject(Sketcher::SketchObject,Sketch) App.getDocument(Unnamed).getObject(Sketch).Support (App.getDocument(Unnamed).getObject(XY_Plane),[]) App.getDocument(Unnamed).getObject(Sketch).MapMode FlatFace App.ActiveDocument.recompute() # Gui.Selection.clearSelection() App.getDocument(Unnamed).getObject(Sketch).addGeometry(Part.Circle(App.Vector(0.0,0.000000,0),App.Vector(0,0,1),R),False) App.getDocument(Unnamed).getObject(Sketch).addConstraint(Sketcher.Constraint(PointOnObject,0,3,-1)) App.ActiveDocument.recompute() # Gui.Selection.addSelection(Unnamed,Body,Sketch.Edge1,19.808,16.0901,0) App.getDocument(Unnamed).getObject(Sketch).addConstraint(Sketcher.Constraint(Diameter,0,R*2)) #App.getDocument(Unnamed).getObject(Sketch).setDatum(1,App.Units.Quantity(49.570000 mm)) App.ActiveDocument.recompute() App.ActiveDocument.recompute() # Gui.Selection.clearSelection() # Gui.Selection.addSelection(Unnamed,Body,Sketch.Vertex1,0.954255,0,0) # Gui.Selection.addSelection(Unnamed,Body,Sketch.V_Axis,0,-0.04614,0) App.getDocument(Unnamed).getObject(Sketch).addConstraint(Sketcher.Constraint(PointOnObject,0,3,-2)) App.ActiveDocument.recompute() # Gui.Selection.clearSelection() App.ActiveDocument.recompute() # Gui.Selection.addSelection(Unnamed,Body,Sketch.) App.getDocument(Unnamed).recompute() ### Begin command PartDesign_Pad App.getDocument(Unnamed).getObject(Body).newObject(PartDesign::Pad,Pad) App.getDocument(Unnamed).getObject(Pad).Profile App.getDocument(Unnamed).getObject(Sketch) App.getDocument(Unnamed).getObject(Pad).Length L App.ActiveDocument.recompute() App.getDocument(Unnamed).getObject(Pad).ReferenceAxis (App.getDocument(Unnamed).getObject(Sketch),[N_Axis]) App.getDocument(Unnamed).getObject(Sketch).Visibility False App.ActiveDocument.recompute() ### End command PartDesign_Pad # Gui.Selection.clearSelection() App.getDocument(Unnamed).getObject(Pad).TaperAngle 0.000000 App.getDocument(Unnamed).getObject(Pad).UseCustomVector 0 App.getDocument(Unnamed).getObject(Pad).Direction (0, 0, 1) App.getDocument(Unnamed).getObject(Pad).ReferenceAxis (App.getDocument(Unnamed).getObject(Sketch), [N_Axis]) App.getDocument(Unnamed).getObject(Pad).AlongSketchNormal 1 App.getDocument(Unnamed).getObject(Pad).Type 0 App.getDocument(Unnamed).getObject(Pad).UpToFace None App.getDocument(Unnamed).getObject(Pad).Reversed 0 App.getDocument(Unnamed).getObject(Pad).Midplane 0 App.getDocument(Unnamed).getObject(Pad).Offset 0 App.getDocument(Unnamed).recompute() App.getDocument(Unnamed).getObject(Sketch).Visibility False # Gui.Selection.addSelection(Unnamed,Body) # Gui.Selection.clearSelection() # Gui.Selection.addSelection(Unnamed,Body,Origin.XY_Plane.,-18.5177,-32.2205,0) App.getDocument(Unnamed).getObject(Body).newObject(Sketcher::SketchObject,Sketch001) App.getDocument(Unnamed).getObject(Sketch001).Support (App.getDocument(Unnamed).getObject(XY_Plane),[]) App.getDocument(Unnamed).getObject(Sketch001).MapMode FlatFace App.ActiveDocument.recompute() # Gui.Selection.clearSelection() ### Begin command Sketcher_ViewSketch ### End command Sketcher_ViewSketch ### Begin command Sketcher_ViewSection #ActiveSketch.ViewObject.TempoVis.sketchClipPlane(ActiveSketch, None, False)### End command Sketcher_ViewSection App.getDocument(Unnamed).getObject(Sketch001).addConstraint(Sketcher.Constraint(Coincident,4,1,-1,1)) App.ActiveDocument.recompute() # Gui.Selection.addSelection(Unnamed,Body,Sketch001.Edge4,2.50686,-10.9,0) App.getDocument(Unnamed).getObject(Sketch001).addConstraint(Sketcher.Constraint(DistanceX,3,2,3,1,DX)) #App.getDocument(Unnamed).getObject(Sketch001).setDatum(10,App.Units.Quantity(21.870000 mm)) App.ActiveDocument.recompute() App.ActiveDocument.recompute() # Gui.Selection.clearSelection() # Gui.Selection.addSelection(Unnamed,Body,Sketch001.Edge3,10.935,6.8364,0) App.getDocument(Unnamed).getObject(Sketch001).addConstraint(Sketcher.Constraint(DistanceY,2,2,2,1,DY)) #App.getDocument(Unnamed).getObject(Sketch001).setDatum(11,App.Units.Quantity(21.800000 mm)) App.ActiveDocument.recompute() App.ActiveDocument.recompute() # Gui.Selection.clearSelection() App.ActiveDocument.recompute() # Gui.Selection.addSelection(Unnamed,Body,Sketch001.) App.getDocument(Unnamed).recompute() ### Begin command PartDesign_Pocket App.getDocument(Unnamed).getObject(Body).newObject(PartDesign::Pocket,Pocket) App.getDocument(Unnamed).getObject(Pocket).Profile App.getDocument(Unnamed).getObject(Sketch001) App.getDocument(Unnamed).getObject(Pocket).Length 5 App.ActiveDocument.recompute() App.getDocument(Unnamed).getObject(Pocket).ReferenceAxis (App.getDocument(Unnamed).getObject(Sketch001),[N_Axis]) App.getDocument(Unnamed).getObject(Sketch001).Visibility False App.ActiveDocument.recompute() ### End command PartDesign_Pocket # Gui.Selection.clearSelection() App.getDocument(Unnamed).getObject(Pocket).UseCustomVector 0 App.getDocument(Unnamed).getObject(Pocket).Direction (0, 0, -1) App.getDocument(Unnamed).getObject(Pocket).ReferenceAxis (App.getDocument(Unnamed).getObject(Sketch001), [N_Axis]) App.getDocument(Unnamed).getObject(Pocket).AlongSketchNormal 1 App.getDocument(Unnamed).getObject(Pocket).Type 1 App.getDocument(Unnamed).getObject(Pocket).UpToFace None App.getDocument(Unnamed).getObject(Pocket).Reversed 1 App.getDocument(Unnamed).getObject(Pocket).Midplane 0 App.getDocument(Unnamed).getObject(Pocket).Offset 0 App.getDocument(Unnamed).recompute() App.getDocument(Unnamed).getObject(Pad).Visibility False App.getDocument(Unnamed).getObject(Sketch001).Visibility False### Begin command Std_Export __objs__ [] __objs__.append(FreeCAD.getDocument(Unnamed).getObject(Body)) import importWebGL if hasattr(importWebGL, exportOptions):options importWebGL.exportOptions(u/home/liwentao/demo/freeCAD/RandomCoin.html)importWebGL.export(__objs__, u/home/liwentao/demo/freeCAD/RandomCoin.html, options) else:importWebGL.export(__objs__, u/home/liwentao/demo/freeCAD/RandomCoin.html) del __objs__ ### End command Std_Export # Macro End: /home/liwentao/.local/share/FreeCAD/Macro/myRandomCoin.FCMacro 保存得到的webGL格式文件可用浏览器打开
http://www.zqtcl.cn/news/480912/

相关文章:

  • wordpress网站+搬家自做购物网站多少钱
  • 用自己网站做淘宝客深圳上市公司一览表
  • 如何用图片文字做网站建设部网站安全事故
  • 订制网站网易企业邮箱怎么修改密码
  • 一小时做网站网上免费设计效果图
  • 网站如何注册域名公司主页填什么
  • 南宁国贸网站建设网站跟网页有什么区别
  • 兰州企业 网站建设短链接在线转换
  • 长沙网上商城网站建设方案导航网站系统
  • 网站更换目录名如何做301跳转网站活泼
  • 化妆品网站网页设计怎样在淘宝网做网站
  • 邢台建站湛江海田网站建设招聘
  • 免费个人网站建站能上传视频吗中国舆情在线网
  • 网站开发项目的心得体会惠州建设厅网站
  • 网站小程序怎么做北京单位网站建设培训
  • 北京市专业网站建设广州安全教育平台登录账号登录入口
  • 广州做网站的价格三个关键词介绍自己
  • 基于工作过程的商务网站建设:网页制作扬州网站建设公元国际
  • wordpress著名网站微信公众号怎么做网站链接
  • 长沙网站建设大概多少钱深圳做网站网络营销公司
  • 融资平台排行榜企业网站seo运营
  • 英文手表网站南昌装修网站建设
  • 网站建设要懂哪些技术甘肃园区网络搭建
  • go做的网站微信跳转链接生成器免费
  • 网站开发中怎么设置快捷键怎样打开用sql做的网站
  • 做餐饮企业网站的费用短视频素材免费下载网站
  • 美食优秀设计网站制作网页网站
  • 提供网站建设教学视频做淘宝美工需要知道的网站
  • 百度云可以做网站吗织梦网站下载
  • 有没有一起做游戏棋牌网站的用wordpress做商城