occt-gltf-addon-linux-x64 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE_LGPL_21.txt +502 -0
- package/OCCT_LGPL_EXCEPTION.txt +10 -0
- package/README.md +2 -2
- package/index.js +63 -1
- package/lib/libTKBO.so.8.0.0 +0 -0
- package/lib/libTKBRep.so.8.0.0 +0 -0
- package/lib/libTKBin.so.8.0.0 +0 -0
- package/lib/libTKBinL.so.8.0.0 +0 -0
- package/lib/libTKBinTObj.so.8.0.0 +0 -0
- package/lib/libTKBinXCAF.so.8.0.0 +0 -0
- package/lib/libTKBool.so.8.0.0 +0 -0
- package/lib/libTKCAF.so.8.0.0 +0 -0
- package/lib/libTKCDF.so.8.0.0 +0 -0
- package/lib/libTKDE.so.8.0.0 +0 -0
- package/lib/libTKDECascade.so.8.0.0 +0 -0
- package/lib/libTKDEIGES.so.8.0.0 +0 -0
- package/lib/libTKDEOBJ.so.8.0.0 +0 -0
- package/lib/libTKDEPLY.so.8.0.0 +0 -0
- package/lib/libTKDESTEP.so.8.0.0 +0 -0
- package/lib/libTKDESTL.so.8.0.0 +0 -0
- package/lib/libTKDEVRML.so.8.0.0 +0 -0
- package/lib/libTKExpress.so.8.0.0 +0 -0
- package/lib/libTKFeat.so.8.0.0 +0 -0
- package/lib/libTKFillet.so.8.0.0 +0 -0
- package/lib/libTKG2d.so.8.0.0 +0 -0
- package/lib/libTKG3d.so.8.0.0 +0 -0
- package/lib/libTKGeomAlgo.so.8.0.0 +0 -0
- package/lib/libTKGeomBase.so.8.0.0 +0 -0
- package/lib/libTKHLR.so.8.0.0 +0 -0
- package/lib/libTKHelix.so.8.0.0 +0 -0
- package/lib/libTKLCAF.so.8.0.0 +0 -0
- package/lib/libTKMath.so.8.0.0 +0 -0
- package/lib/libTKMesh.so.8.0.0 +0 -0
- package/lib/libTKOffset.so.8.0.0 +0 -0
- package/lib/libTKPrim.so.8.0.0 +0 -0
- package/lib/libTKRWMesh.so.8.0.0 +0 -0
- package/lib/libTKService.so.8.0.0 +0 -0
- package/lib/libTKShHealing.so.8.0.0 +0 -0
- package/lib/libTKStd.so.8.0.0 +0 -0
- package/lib/libTKStdL.so.8.0.0 +0 -0
- package/lib/libTKTObj.so.8.0.0 +0 -0
- package/lib/libTKTopAlgo.so.8.0.0 +0 -0
- package/lib/libTKV3d.so.8.0.0 +0 -0
- package/lib/libTKVCAF.so.8.0.0 +0 -0
- package/lib/libTKXCAF.so.8.0.0 +0 -0
- package/lib/libTKXMesh.so.8.0.0 +0 -0
- package/lib/libTKXSBase.so.8.0.0 +0 -0
- package/lib/libTKXml.so.8.0.0 +0 -0
- package/lib/libTKXmlL.so.8.0.0 +0 -0
- package/lib/libTKXmlTObj.so.8.0.0 +0 -0
- package/lib/libTKXmlXCAF.so.8.0.0 +0 -0
- package/lib/libTKernel.so.8.0.0 +0 -0
- package/lib/libdraco.so.1 +0 -0
- package/lib/libtbb.so.2 +0 -0
- package/lib/libtbbmalloc.so.2 +0 -0
- package/lib/libtbbmalloc_proxy.so.2 +0 -0
- package/occt_gltf_addon.node +0 -0
- package/package.json +6 -2
- package/resources/BOPAlgo/BOPAlgo.msg +129 -0
- package/resources/BOPAlgo/FILES +1 -0
- package/resources/DrawResources/CURVES.tcl +38 -0
- package/resources/DrawResources/CheckCommands.tcl +1206 -0
- package/resources/DrawResources/DrawDefault +130 -0
- package/resources/DrawResources/DrawPlugin +64 -0
- package/resources/DrawResources/DrawTK.tcl +623 -0
- package/resources/DrawResources/FILES +16 -0
- package/resources/DrawResources/Geometry.tcl +96 -0
- package/resources/DrawResources/InitEnvironment.tcl +50 -0
- package/resources/DrawResources/Move.tcl +85 -0
- package/resources/DrawResources/OCC_logo.png +0 -0
- package/resources/DrawResources/PROFIL.tcl +726 -0
- package/resources/DrawResources/SCAN.tcl +192 -0
- package/resources/DrawResources/SURFACES.tcl +35 -0
- package/resources/DrawResources/StandardCommands.tcl +451 -0
- package/resources/DrawResources/StandardViews.tcl +284 -0
- package/resources/DrawResources/TKTopTest.tcl +27 -0
- package/resources/DrawResources/TestCommands.tcl +2969 -0
- package/resources/DrawResources/Vector.tcl +402 -0
- package/resources/DrawResources/dfb_attribns.gif +0 -0
- package/resources/DrawResources/dfb_attribute.gif +0 -0
- package/resources/DrawResources/dfb_folder.gif +0 -0
- package/resources/DrawResources/dftree.tcl +381 -0
- package/resources/DrawResources/lamp.ico +0 -0
- package/resources/SHMessage/FILES +2 -0
- package/resources/SHMessage/SHAPE.fr +267 -0
- package/resources/SHMessage/SHAPE.us +267 -0
- package/resources/Shaders/Declarations.glsl +276 -0
- package/resources/Shaders/DeclarationsImpl.glsl +121 -0
- package/resources/Shaders/Display.fs +157 -0
- package/resources/Shaders/FILES +27 -0
- package/resources/Shaders/LightShadow.glsl +48 -0
- package/resources/Shaders/PBRCookTorrance.glsl +20 -0
- package/resources/Shaders/PBRDirectionalLight.glsl +20 -0
- package/resources/Shaders/PBRDistribution.glsl +9 -0
- package/resources/Shaders/PBREnvBaking.fs +226 -0
- package/resources/Shaders/PBREnvBaking.vs +55 -0
- package/resources/Shaders/PBRFresnel.glsl +36 -0
- package/resources/Shaders/PBRGeometry.glsl +13 -0
- package/resources/Shaders/PBRIllumination.glsl +28 -0
- package/resources/Shaders/PBRPointLight.glsl +27 -0
- package/resources/Shaders/PBRSpotLight.glsl +45 -0
- package/resources/Shaders/PathtraceBase.fs +993 -0
- package/resources/Shaders/PhongDirectionalLight.glsl +29 -0
- package/resources/Shaders/PhongPointLight.glsl +36 -0
- package/resources/Shaders/PhongShading.fs +191 -0
- package/resources/Shaders/PhongShading.vs +43 -0
- package/resources/Shaders/PhongSpotLight.glsl +52 -0
- package/resources/Shaders/PointLightAttenuation.glsl +35 -0
- package/resources/Shaders/RaytraceBase.fs +1236 -0
- package/resources/Shaders/RaytraceBase.vs +12 -0
- package/resources/Shaders/RaytraceRender.fs +134 -0
- package/resources/Shaders/RaytraceSmooth.fs +80 -0
- package/resources/Shaders/SkydomBackground.fs +300 -0
- package/resources/Shaders/TangentSpaceNormal.glsl +17 -0
- package/resources/StdResource/FILES +6 -0
- package/resources/StdResource/MigrationSheet.txt +21 -0
- package/resources/StdResource/Plugin +52 -0
- package/resources/StdResource/Standard +25 -0
- package/resources/StdResource/StandardLite +22 -0
- package/resources/StdResource/TObj +17 -0
- package/resources/StdResource/XCAF +50 -0
- package/resources/TObj/FILES +1 -0
- package/resources/TObj/TObj.msg +85 -0
- package/resources/Textures/1d_elevation.rgb +0 -0
- package/resources/Textures/2d_MatraDatavision.rgb +0 -0
- package/resources/Textures/2d_alienskin.rgb +0 -0
- package/resources/Textures/2d_aluminum.rgb +0 -0
- package/resources/Textures/2d_blue_rock.rgb +0 -0
- package/resources/Textures/2d_bluewhite_paper.rgb +0 -0
- package/resources/Textures/2d_brushed.rgb +0 -0
- package/resources/Textures/2d_bubbles.rgb +0 -0
- package/resources/Textures/2d_bumps.rgb +0 -0
- package/resources/Textures/2d_cast.rgb +0 -0
- package/resources/Textures/2d_chess.rgba +0 -0
- package/resources/Textures/2d_chipbd.rgb +0 -0
- package/resources/Textures/2d_clouds.rgb +0 -0
- package/resources/Textures/2d_flesh.rgb +0 -0
- package/resources/Textures/2d_floor.rgb +0 -0
- package/resources/Textures/2d_galvnisd.rgb +0 -0
- package/resources/Textures/2d_grass.rgb +0 -0
- package/resources/Textures/2d_knurl.rgb +0 -0
- package/resources/Textures/2d_maple.rgb +0 -0
- package/resources/Textures/2d_marble.rgb +0 -0
- package/resources/Textures/2d_mottled.rgb +0 -0
- package/resources/Textures/2d_rain.rgb +0 -0
- package/resources/Textures/2d_rock.rgb +0 -0
- package/resources/Textures/FILES +31 -0
- package/resources/Textures/env_clouds.rgb +0 -0
- package/resources/Textures/env_cv.rgb +0 -0
- package/resources/Textures/env_lines.rgb +0 -0
- package/resources/Textures/env_medit.rgb +0 -0
- package/resources/Textures/env_pearl.rgb +0 -0
- package/resources/Textures/env_road.rgb +0 -0
- package/resources/Textures/env_sky1.rgb +0 -0
- package/resources/Textures/env_sky2.rgb +0 -0
- package/resources/UnitsAPI/CurrentUnits +74 -0
- package/resources/UnitsAPI/FILES +4 -0
- package/resources/UnitsAPI/MDTVBaseUnits +70 -0
- package/resources/UnitsAPI/MDTVCurrentUnits +74 -0
- package/resources/UnitsAPI/Units.dat +481 -0
- package/resources/XRResources/FILES +10 -0
- package/resources/XRResources/occtvr_actions.json +225 -0
- package/resources/XRResources/occtvr_bindings_generic.json +87 -0
- package/resources/XRResources/occtvr_bindings_holographic_hmd.json +18 -0
- package/resources/XRResources/occtvr_bindings_index_hmd.json +18 -0
- package/resources/XRResources/occtvr_bindings_rift.json +18 -0
- package/resources/XRResources/occtvr_bindings_touch.json +160 -0
- package/resources/XRResources/occtvr_bindings_vive.json +18 -0
- package/resources/XRResources/occtvr_bindings_vive_controller.json +139 -0
- package/resources/XRResources/occtvr_bindings_vive_cosmos.json +18 -0
- package/resources/XRResources/occtvr_bindings_vive_pro.json +18 -0
- package/resources/XSMessage/FILES +2 -0
- package/resources/XSMessage/XSTEP.fr +1026 -0
- package/resources/XSMessage/XSTEP.us +1023 -0
- package/resources/XSTEPResource/FILES +2 -0
- package/resources/XSTEPResource/IGES +65 -0
- package/resources/XSTEPResource/STEP +68 -0
- package/resources/XmlOcafResource/FILES +11 -0
- package/resources/XmlOcafResource/XmlOcaf.xsd +131 -0
- package/resources/XmlOcafResource/XmlOcaf_SmallTypes.xsd +217 -0
- package/resources/XmlOcafResource/XmlOcaf_TDF.xsd +33 -0
- package/resources/XmlOcafResource/XmlOcaf_TDataStd.xsd +230 -0
- package/resources/XmlOcafResource/XmlOcaf_TDataStd_Name.xsd +37 -0
- package/resources/XmlOcafResource/XmlOcaf_TDocStd.xsd +37 -0
- package/resources/XmlOcafResource/XmlOcaf_TFunction.xsd +38 -0
- package/resources/XmlOcafResource/XmlOcaf_TNaming.xsd +128 -0
- package/resources/XmlOcafResource/XmlOcaf_TNaming_NamedShape.xsd +97 -0
- package/resources/XmlOcafResource/XmlOcaf_TPrsStd.xsd +42 -0
- package/resources/XmlOcafResource/XmlXcaf.xsd +109 -0
- package/resources/samples/tcl/ANC101.tcl +282 -0
- package/resources/samples/tcl/DataExchangeDemo.tcl +85 -0
- package/resources/samples/tcl/MBBGehauseRohteil.tcl +268 -0
- package/resources/samples/tcl/ModelingDemo.tcl +120 -0
- package/resources/samples/tcl/Penrose.tcl +87 -0
- package/resources/samples/tcl/Readme.txt +4 -0
- package/resources/samples/tcl/VisualizationDemo.tcl +162 -0
- package/resources/samples/tcl/bottle.tcl +115 -0
- package/resources/samples/tcl/cad.tcl +63 -0
- package/resources/samples/tcl/cpu.tcl +327 -0
- package/resources/samples/tcl/cutter.tcl +91 -0
- package/resources/samples/tcl/dimensions.tcl +83 -0
- package/resources/samples/tcl/drill.tcl +147 -0
- package/resources/samples/tcl/logo2019.tcl +89 -0
- package/resources/samples/tcl/markers.tcl +76 -0
- package/resources/samples/tcl/materials.tcl +75 -0
- package/resources/samples/tcl/pathtrace_ball.tcl +79 -0
- package/resources/samples/tcl/pathtrace_cube.tcl +85 -0
- package/resources/samples/tcl/pathtrace_materials.tcl +229 -0
- package/resources/samples/tcl/pencil.tcl +64 -0
- package/resources/samples/tcl/raytrace.tcl +44 -0
- package/resources/samples/tcl/snowflake.tcl +161 -0
- package/resources/samples/tcl/spheres.tcl +148 -0
- package/resources/samples/tcl/vis_pbr_spheres.tcl +94 -0
- package/resources/samples/tcl/xde.tcl +47 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Script reproducing creation of bottle model as described in OCCT Tutorial
|
|
2
|
+
#Category: Modeling
|
|
3
|
+
#Title: OCCT Tutorial bottle shape
|
|
4
|
+
|
|
5
|
+
pload MODELING VISUALIZATION
|
|
6
|
+
|
|
7
|
+
puts "Constructing bottle body..."
|
|
8
|
+
|
|
9
|
+
# set basic dimensions
|
|
10
|
+
dset height 70
|
|
11
|
+
dset width 50
|
|
12
|
+
dset thickness 30
|
|
13
|
+
|
|
14
|
+
# construct base profile (half)
|
|
15
|
+
vertex v1 -width/2 0 0
|
|
16
|
+
vertex v2 -width/2 -thickness/4 0
|
|
17
|
+
edge e1 v1 v2
|
|
18
|
+
|
|
19
|
+
point p2 -width/2 -thickness/4 0
|
|
20
|
+
point p3 0 -thickness/2 0
|
|
21
|
+
point p4 width/2 -thickness/4 0
|
|
22
|
+
catch {gcarc arc cir p2 p3 p4}
|
|
23
|
+
mkedge e2 arc
|
|
24
|
+
|
|
25
|
+
vertex v4 width/2 -thickness/4 0
|
|
26
|
+
vertex v5 width/2 0 0
|
|
27
|
+
edge e3 v4 v5
|
|
28
|
+
|
|
29
|
+
wire w1 e1 e2 e3
|
|
30
|
+
|
|
31
|
+
# complete profile by mirror and make a prism
|
|
32
|
+
copy w1 w2
|
|
33
|
+
tmirror w2 0 0 0 0 1 0
|
|
34
|
+
|
|
35
|
+
wire w3 w1 w2
|
|
36
|
+
mkplane f w3
|
|
37
|
+
|
|
38
|
+
prism p f 0 0 height
|
|
39
|
+
|
|
40
|
+
# fillet all edges
|
|
41
|
+
explode p e
|
|
42
|
+
blend b p thickness/12 p_1 thickness/12 p_2 thickness/12 p_3 thickness/12 p_4 thickness/12 p_5 thickness/12 p_6 thickness/12 p_7 thickness/12 p_8 thickness/12 p_9 thickness/12 p_10 thickness/12 p_11 thickness/12 p_12 thickness/12 p_13 thickness/12 p_14 thickness/12 p_15 thickness/12 p_16 thickness/12 p_17 thickness/12 p_18
|
|
43
|
+
|
|
44
|
+
# neck dimensions
|
|
45
|
+
dset neckradius thickness/4
|
|
46
|
+
dset neckheight height/10
|
|
47
|
+
|
|
48
|
+
# add neck
|
|
49
|
+
pcylinder c neckradius neckheight
|
|
50
|
+
ttranslate c 0 0 height
|
|
51
|
+
|
|
52
|
+
bfuse f b c
|
|
53
|
+
|
|
54
|
+
# make body hollow
|
|
55
|
+
explode c f
|
|
56
|
+
offsetshape body f -thickness/50 1.e-3 c_2
|
|
57
|
+
|
|
58
|
+
puts "Constructing threading..."
|
|
59
|
+
|
|
60
|
+
# make two cylinders
|
|
61
|
+
cylinder c1 0 0 height 0 0 1 neckradius*0.99
|
|
62
|
+
cylinder c2 0 0 height 0 0 1 neckradius*1.05
|
|
63
|
+
|
|
64
|
+
# define threading dimensions in parametric space
|
|
65
|
+
dset major 2*pi
|
|
66
|
+
dset minor neckheight/10
|
|
67
|
+
|
|
68
|
+
# make parametric curves for threading
|
|
69
|
+
ellipse el1 2*pi neckheight/2 2*pi neckheight/4 major minor
|
|
70
|
+
ellipse el2 2*pi neckheight/2 2*pi neckheight/4 major minor/4
|
|
71
|
+
|
|
72
|
+
trim arc1 el1 0 pi
|
|
73
|
+
trim arc2 el2 0 pi
|
|
74
|
+
|
|
75
|
+
2dcvalue el1 0 x1 y1
|
|
76
|
+
2dcvalue el1 pi x2 y2
|
|
77
|
+
|
|
78
|
+
line l x1 y1 x2-x1 y2-y1
|
|
79
|
+
parameters l x2 y2 1.e-9 U
|
|
80
|
+
trim s l 0 U
|
|
81
|
+
|
|
82
|
+
# construct 3d edges and wires
|
|
83
|
+
mkedge E1OnS1 arc1 c1 0 pi
|
|
84
|
+
mkedge E2OnS1 s c1 0 U
|
|
85
|
+
mkedge E1OnS2 arc2 c2 0 pi
|
|
86
|
+
mkedge E2OnS2 s c2 0 U
|
|
87
|
+
|
|
88
|
+
wire tw1 E1OnS1 E2OnS1
|
|
89
|
+
wire tw2 E1OnS2 E2OnS2
|
|
90
|
+
mkedgecurve tw1 1.e-5
|
|
91
|
+
mkedgecurve tw2 1.e-5
|
|
92
|
+
|
|
93
|
+
# build threading as solid
|
|
94
|
+
thrusections -N thread 1 0 tw1 tw2
|
|
95
|
+
|
|
96
|
+
puts "Putting together and writing \"Open CASCADE\"..."
|
|
97
|
+
|
|
98
|
+
# define text
|
|
99
|
+
text2brep text2d OpenCASCADE -font Times-Roman -height 8 -aspect bold -composite off
|
|
100
|
+
prism text text2d 0 0 2
|
|
101
|
+
trotate text 0 0 0 0 1 0 90
|
|
102
|
+
ttranslate text 24.75 -2 65
|
|
103
|
+
|
|
104
|
+
# cut operation
|
|
105
|
+
bcut bodytext body text
|
|
106
|
+
bop bodytext thread
|
|
107
|
+
bopfuse bottle
|
|
108
|
+
|
|
109
|
+
puts "Showing result..."
|
|
110
|
+
|
|
111
|
+
# display result
|
|
112
|
+
vdisplay bottle
|
|
113
|
+
vfit
|
|
114
|
+
vsetdispmode 1
|
|
115
|
+
vaspects -isoontriangulation 1
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# This script creates a model described at
|
|
2
|
+
# http://www.caddd.org/2010/04/opencascade-challenge.html
|
|
3
|
+
#Category: Modeling
|
|
4
|
+
#Title: CAD shape
|
|
5
|
+
|
|
6
|
+
pload MODELING VISUALIZATION
|
|
7
|
+
|
|
8
|
+
# make base
|
|
9
|
+
box b0 0 0 0 12 7 6
|
|
10
|
+
explode b0 e
|
|
11
|
+
blend b01 b0 1 b0_8
|
|
12
|
+
blend b02 b01 1 b0_6
|
|
13
|
+
|
|
14
|
+
# make cut at bottom
|
|
15
|
+
box b1 3 -1 0 2 9 1.5
|
|
16
|
+
bcut b2 b02 b1
|
|
17
|
+
explode b2 e
|
|
18
|
+
blend b3 b2 1 b2_27
|
|
19
|
+
blend b4 b3 1 b2_30
|
|
20
|
+
|
|
21
|
+
# make central cut
|
|
22
|
+
box h1 3 -1 2.5 2 9 0.5
|
|
23
|
+
box h2 3 -1 3 2 9 2
|
|
24
|
+
plane p 4 -1 3 0 1 0
|
|
25
|
+
pcylinder c p 1 9
|
|
26
|
+
bcommon h3 h2 c
|
|
27
|
+
bcut b5 b4 h1
|
|
28
|
+
bcut b6 b5 h3
|
|
29
|
+
|
|
30
|
+
# make side cut
|
|
31
|
+
box b7 9 -1 1 2 9 4
|
|
32
|
+
explode b7 e
|
|
33
|
+
blend b71 b7 1 b7_6
|
|
34
|
+
blend b72 b71 1 b7_8
|
|
35
|
+
bcut b8 b6 b72
|
|
36
|
+
|
|
37
|
+
# make box for inner cylindrical cut
|
|
38
|
+
box bc1 -1 0 2 9 1 4
|
|
39
|
+
box bc2 2 -1 2 4 3 3
|
|
40
|
+
bcut bc3 bc1 bc2
|
|
41
|
+
explode bc3 e
|
|
42
|
+
blend bc4 bc3 1 bc3_20
|
|
43
|
+
blend bc5 bc4 1 bc3_23
|
|
44
|
+
blend bc6 bc5 1.99 bc3_21
|
|
45
|
+
blend bc7 bc6 1.99 bc3_22
|
|
46
|
+
|
|
47
|
+
# make inner cylindrical cut
|
|
48
|
+
explode bc7 f
|
|
49
|
+
revol r bc7_1 -1 0 6 1 0 0 100
|
|
50
|
+
bcut b9 b8 r
|
|
51
|
+
|
|
52
|
+
# make outer cylindrical cut
|
|
53
|
+
plane p2 -1 0 6 1 0 0
|
|
54
|
+
pcylinder c2 p2 6 15
|
|
55
|
+
bcommon res b9 c2
|
|
56
|
+
|
|
57
|
+
# show result
|
|
58
|
+
donly res
|
|
59
|
+
trotate res 0 0 0 0 0 1 90
|
|
60
|
+
vinit View1
|
|
61
|
+
vdisplay -dispMode 1 res
|
|
62
|
+
vaspects res -setFaceBoundaryDraw 1 -setFaceBoundaryColor WHITE -isoontriangulation 1
|
|
63
|
+
vfit
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
# Sample model of Intel i7-4790 CPU
|
|
2
|
+
# Dimensions are taken from specs and photo found in Internet
|
|
3
|
+
|
|
4
|
+
#Category: XDE
|
|
5
|
+
#Title: Intel i7-4790 CPU
|
|
6
|
+
|
|
7
|
+
pload MODELING VISUALIZATION XDE
|
|
8
|
+
|
|
9
|
+
puts "Making board..."
|
|
10
|
+
|
|
11
|
+
# board is rectangle 37.5 x 37.5 mm with semi-round holes on two sides;
|
|
12
|
+
# assumed board thickness is 1 mm
|
|
13
|
+
dset L 37.5
|
|
14
|
+
dset t 1.
|
|
15
|
+
polyline pboard 0 0 0 L 0 0 L L 0 0 L 0 0 0 0
|
|
16
|
+
mkplane fboard pboard
|
|
17
|
+
circle cslot -0.2 32.2 0 1
|
|
18
|
+
mkedge eslot cslot
|
|
19
|
+
wire wslot eslot
|
|
20
|
+
mkplane fslot wslot
|
|
21
|
+
bcut fboard fboard fslot
|
|
22
|
+
ttranslate fslot L+0.4 0 0
|
|
23
|
+
bcut fboard fboard fslot
|
|
24
|
+
prism board fboard 0 0 t
|
|
25
|
+
|
|
26
|
+
# make faces representing dard-green parts of the board sides
|
|
27
|
+
mkoffset dgbot fboard 1 -0.5
|
|
28
|
+
mkplane dgbot dgbot_1
|
|
29
|
+
tcopy dgbot dgtop
|
|
30
|
+
ttranslate dgtop 0 0 0.5*t
|
|
31
|
+
box aux 36.6 17.7 0 10 8.4 2*t
|
|
32
|
+
bcut dgtop dgtop aux
|
|
33
|
+
prism pbot dgbot 0 0 0.5*t
|
|
34
|
+
prism ptop dgtop 0 0 0.5*t
|
|
35
|
+
bfuse board board pbot
|
|
36
|
+
bfuse board board ptop
|
|
37
|
+
|
|
38
|
+
# add triangular faces indicating base corner of the plate
|
|
39
|
+
polyline btri 0.5 0.5 0 1.5 0.5 0 0.5 1.5 0 0.5 0.5 0
|
|
40
|
+
polyline ttri 0.5 0.5 t 2.5 0.5 t 0.5 2.5 t 0.5 0.5 t
|
|
41
|
+
thrusections stri 1 1 btri ttri
|
|
42
|
+
bfuse board board stri
|
|
43
|
+
|
|
44
|
+
explode board so
|
|
45
|
+
renamevar board_1 board
|
|
46
|
+
|
|
47
|
+
puts "Making case..."
|
|
48
|
+
|
|
49
|
+
# case is made of two filleted prisms, base and top
|
|
50
|
+
polyline lbase 3.4 1.8 t L-3.4 1.8 t L-3.4 11.4 t L-1.8 11.4 t L-1.8 25.2 t \
|
|
51
|
+
L-3.4 25.2 t L-3.4 L-3 t 3.4 L-3 t 3.4 25.2 t \
|
|
52
|
+
1.8 25.2 t 1.8 11.4 t 3.4 11.4 t 3.4 1.8 t
|
|
53
|
+
mkplane f lbase
|
|
54
|
+
explode f e
|
|
55
|
+
chfi2d fbase f f_1 f_2 F 1.3 f_2 f_3 F 0.7 f_3 f_4 F 0.7 f_4 f_5 F 0.7 \
|
|
56
|
+
f_5 f_6 F 0.7 f_6 f_7 F 1.3 f_7 f_8 F 1.3 f_8 f_9 F 0.7 \
|
|
57
|
+
f_9 f_10 F 0.7 f_10 f_11 F 0.7 f_11 f_12 F 0.7 f_12 f_1 F 1.3
|
|
58
|
+
|
|
59
|
+
polyline ltop 4. 3.4 t L-4 3.4 t L-4 L-4.8 t 4 L-4.8 t 4. 3.4 t
|
|
60
|
+
mkplane f ltop
|
|
61
|
+
explode f e
|
|
62
|
+
chfi2d ftop f f_1 f_2 F 1.6 f_2 f_3 F 1.6 f_3 f_4 F 1.6 f_4 f_1 F 1.6
|
|
63
|
+
|
|
64
|
+
# make case, assume height of base 1 mm and top additional 2.5 mm
|
|
65
|
+
prism pbase fbase 0 0 1
|
|
66
|
+
prism ptop ftop 0 0 3.5
|
|
67
|
+
bfuse case pbase ptop
|
|
68
|
+
|
|
69
|
+
explode case so
|
|
70
|
+
renamevar case_1 case
|
|
71
|
+
|
|
72
|
+
# write text on top of the case
|
|
73
|
+
# note that font is chosen by availability of Unicode symbols,
|
|
74
|
+
# it is different from actual font found on processor
|
|
75
|
+
set font "Arial Unicode MS"
|
|
76
|
+
#set text "i\u24c2\u00a911\nINTEL\u00ae CORE\u2122 i7-4790\nSR1QF 3.60GHZ\nMALAY\nL411B540 \u24d4"
|
|
77
|
+
#text2brep title $text "Arial Unicode MS" 1.7 x=10 y=24 z=4.51
|
|
78
|
+
# alternative variant to work-around issue #25852
|
|
79
|
+
set text "i\u20dd\u20dd11\nINTEL\u20dd CORE\u2122 i7-4790\nSR1QF 3.60GHZ\nMALAY\nL411B540 \u20dd"
|
|
80
|
+
text2brep title0 $text -font $font -height 1.7 -pos 10 24 4.51 -valign topfirstline
|
|
81
|
+
text2brep title1 " M C" -font $font -height 0.77 -pos 10 24.2 4.51
|
|
82
|
+
text2brep title2 "R" -font $font -height 0.77 -pos 15.3 21.9 4.51
|
|
83
|
+
text2brep title3 "e4" -font $font -height 0.7 -pos 18.6 15.1 4.51
|
|
84
|
+
compound title0 title1 title2 title3 title
|
|
85
|
+
|
|
86
|
+
puts "Adding contact pads..."
|
|
87
|
+
|
|
88
|
+
# contact pads on top side (round); we need 42 with R=0.3 and 1 with R=0.6
|
|
89
|
+
pcylinder rpad 0.27 0.1
|
|
90
|
+
eval compound [lrepeat 42 rpad] cpad
|
|
91
|
+
set lpad [explode cpad]
|
|
92
|
+
for {set i 1} {$i <= 20} {incr i} {
|
|
93
|
+
ttranslate cpad_[expr 2*$i ] [expr 4.5 + $i * 0.7] L-0.7 t
|
|
94
|
+
ttranslate cpad_[expr 2*$i-1] [expr 4.85 + $i * 0.7] L-1.3 t
|
|
95
|
+
}
|
|
96
|
+
ttranslate cpad_41 L-0.7 L-0.7 t
|
|
97
|
+
ttranslate cpad_42 L-0.7 0.7 t
|
|
98
|
+
pcylinder Rpad 0.5 0.1
|
|
99
|
+
ttranslate Rpad 0.9 L-0.9 t
|
|
100
|
+
eval compound $lpad Rpad rpads
|
|
101
|
+
|
|
102
|
+
# contact pads at the bottom
|
|
103
|
+
box pad -0.45 -0.27 -0.1 0.9 0.54 0.1
|
|
104
|
+
trotate pad 0 0 0 0 0 1 60
|
|
105
|
+
ellipse c 0 0 -0.1 0.5 0.4
|
|
106
|
+
mkedge e c
|
|
107
|
+
wire w e
|
|
108
|
+
mkplane f w
|
|
109
|
+
prism b f 0 0 0.1
|
|
110
|
+
bcommon bpad pad b
|
|
111
|
+
explode bpad so
|
|
112
|
+
renamevar bpad_1 bpad
|
|
113
|
+
#donly bpad; boundings bpad
|
|
114
|
+
|
|
115
|
+
# pattern of presence of bottom pads, on XY plane (top view)
|
|
116
|
+
set pattern [join {
|
|
117
|
+
..ooooooooooooooo...ooooooooooooooooo...
|
|
118
|
+
.oooooooooooooooo...ooooooooooooooooooo.
|
|
119
|
+
.oooooooooooooooooooooooooooooooooooooo.
|
|
120
|
+
.oooooooooooooooooooooooooooooooooooooo.
|
|
121
|
+
.oooooooooooooooooooooooooooooooooooooo.
|
|
122
|
+
.oooooooooooooooooooooooooooooooooooooo.
|
|
123
|
+
.oooooooooooooooooooooooooooooooooooooo.
|
|
124
|
+
.oooooooooooooooooooooooooooooooooooooo.
|
|
125
|
+
.ooooooooooo................ooooooooooo.
|
|
126
|
+
.oooooooooo.................ooooooooooo.
|
|
127
|
+
oooooooooooo................oooooooooooo
|
|
128
|
+
oooooooooooo................oooooooooooo
|
|
129
|
+
oooooooooooo................oooooooooooo
|
|
130
|
+
oooooooooooo................oooooooooooo
|
|
131
|
+
oooooooooooo................oooooooooooo
|
|
132
|
+
oooooooooooo................oooooooooooo
|
|
133
|
+
oooooooooooo................oooooooooooo
|
|
134
|
+
oooooooooooo................oooooooooooo
|
|
135
|
+
..oooooooooo................oooooooooo..
|
|
136
|
+
..oooooooooo................oooooooooo..
|
|
137
|
+
..oooooooooo................oooooooooo..
|
|
138
|
+
..oooooooooo................oooooooooo..
|
|
139
|
+
oooooooooooo................oooooooooooo
|
|
140
|
+
oooooooooooo................oooooooooooo
|
|
141
|
+
oooooooooooo................oooooooooooo
|
|
142
|
+
oooooooooooo................oooooooooooo
|
|
143
|
+
oooooooooooo................oooooooooooo
|
|
144
|
+
oooooooooooo................oooooooooooo
|
|
145
|
+
oooooooooooo................oooooooooooo
|
|
146
|
+
oooooooooooo................oooooooooooo
|
|
147
|
+
.ooooooooooo.................ooooooooooo
|
|
148
|
+
.ooooooooooo................oooooooooooo
|
|
149
|
+
.ooooooooooooooooooooooooooooooooooooooo
|
|
150
|
+
oooooooooooooooooooooooooooooooooooooooo
|
|
151
|
+
oooooooooooooooooooooooooooooooooooooooo
|
|
152
|
+
oooooooooooooooooooooooooooooooooooooooo
|
|
153
|
+
oooooooooooooooooooooooooooooooooooooooo
|
|
154
|
+
.ooooooooooooooooooooooooooooooooooooooo
|
|
155
|
+
..oooooooooooooooo...oooooooooooooooooo.
|
|
156
|
+
...ooooooooooooooo...ooooooooooooooooo..
|
|
157
|
+
} ""]
|
|
158
|
+
|
|
159
|
+
set nbpads 0
|
|
160
|
+
for {set i 0} {$i < 1600} {incr i} {
|
|
161
|
+
if { [string index $pattern $i] == "o" } { incr nbpads }
|
|
162
|
+
}
|
|
163
|
+
eval compound [lrepeat $nbpads bpad] cpad
|
|
164
|
+
set lpad [explode cpad]
|
|
165
|
+
for {set ipad 1; set iplace 0} {$ipad <= $nbpads && $iplace < 1600} {incr ipad; incr iplace} {
|
|
166
|
+
while { [string index $pattern $iplace] == "." } { incr iplace }
|
|
167
|
+
set icol [expr $iplace % 40]
|
|
168
|
+
set irow [expr $iplace / 40]
|
|
169
|
+
ttranslate cpad_$ipad [expr 1 + 0.91 * $icol] [expr [dval L] - 1 - 0.91 * $irow] 0
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
# round and square contact pads on top side
|
|
173
|
+
# note re-use of rpad object used for bottom round pads
|
|
174
|
+
eval compound [lrepeat 8 rpad] crpads
|
|
175
|
+
set lrpad [explode crpads]
|
|
176
|
+
ttranslate crpads_1 25.3 8.4 -0.1
|
|
177
|
+
ttranslate crpads_2 12.2 29.2 -0.1
|
|
178
|
+
ttranslate crpads_3 12.5 15. -0.1
|
|
179
|
+
ttranslate crpads_4 12.5 18.75 -0.1
|
|
180
|
+
ttranslate crpads_5 12.5 19.5 -0.1
|
|
181
|
+
ttranslate crpads_6 12.5 20.25 -0.1
|
|
182
|
+
ttranslate crpads_7 12.5 21. -0.1
|
|
183
|
+
ttranslate crpads_8 12.5 22.5 -0.1
|
|
184
|
+
box spad_1 12.21 13.75 -0.1 0.58 0.58 0.1
|
|
185
|
+
box spad_2 12.21 23.2 -0.1 0.58 0.58 0.1
|
|
186
|
+
|
|
187
|
+
# final compound for all bottom pads
|
|
188
|
+
eval compound $lpad $lrpad spad_1 spad_2 bpads
|
|
189
|
+
|
|
190
|
+
# resistor-like packages at the bottom
|
|
191
|
+
box rpk1 -0.6 -0.25 -0.5 0.3 0.5 0.5
|
|
192
|
+
box rpk2 -0.3 -0.25 -0.5 0.6 0.5 0.5
|
|
193
|
+
box rpk3 0.3 -0.25 -0.5 0.3 0.5 0.5
|
|
194
|
+
compound rpk1 rpk2 rpk3 rpk
|
|
195
|
+
|
|
196
|
+
eval compound [lrepeat 47 rpk] crpk
|
|
197
|
+
set lrpk [explode crpk]
|
|
198
|
+
# rotate first 26 packages vertically
|
|
199
|
+
for {set i 1} {$i <= 26} {incr i} {trotate crpk_$i 0 0 0 0 0 1 90}
|
|
200
|
+
# first 9 are vertical column on the right side of the bottom view
|
|
201
|
+
for {set i 1} {$i <= 9} {incr i} {
|
|
202
|
+
ttranslate crpk_$i 13.4 [expr 9.8 + 1.6 * $i] 0
|
|
203
|
+
}
|
|
204
|
+
# next 8 are 2x4 grid in top left corner
|
|
205
|
+
for {set i 1} {$i <= 4} {incr i} {
|
|
206
|
+
ttranslate crpk_[expr 9 + $i] 23. [expr 21.5 + 1.6 * $i] 0
|
|
207
|
+
ttranslate crpk_[expr 13 + $i] 24. [expr 21.5 + 1.6 * $i] 0
|
|
208
|
+
}
|
|
209
|
+
# others are translated individually, vertical first, bottom to top
|
|
210
|
+
ttranslate crpk_18 21.5 9.4 0
|
|
211
|
+
ttranslate crpk_19 21.5 11.0 0
|
|
212
|
+
ttranslate crpk_20 21.5 12.6 0
|
|
213
|
+
ttranslate crpk_21 22.5 9.8 0
|
|
214
|
+
ttranslate crpk_22 20.0 12.2 0
|
|
215
|
+
ttranslate crpk_23 24.0 13.6 0
|
|
216
|
+
ttranslate crpk_24 24.0 15.2 0
|
|
217
|
+
ttranslate crpk_25 19.5 16.0 0
|
|
218
|
+
ttranslate crpk_26 20.5 16.0 0
|
|
219
|
+
# now horizontal, bottom to top
|
|
220
|
+
ttranslate crpk_27 23.7 9.5 0
|
|
221
|
+
ttranslate crpk_28 23.7 10.5 0
|
|
222
|
+
ttranslate crpk_29 22.8 11.5 0
|
|
223
|
+
ttranslate crpk_30 22.8 12.5 0
|
|
224
|
+
ttranslate crpk_31 22.7 14.3 0
|
|
225
|
+
ttranslate crpk_32 22.7 16.0 0
|
|
226
|
+
ttranslate crpk_33 22.8 17.0 0
|
|
227
|
+
ttranslate crpk_34 22.8 19.1 0
|
|
228
|
+
ttranslate crpk_35 22.7 20.0 0
|
|
229
|
+
ttranslate crpk_36 23.0 20.9 0
|
|
230
|
+
ttranslate crpk_37 23.3 21.8 0
|
|
231
|
+
|
|
232
|
+
ttranslate crpk_38 19.8 21.6 0
|
|
233
|
+
ttranslate crpk_39 19.8 22.6 0
|
|
234
|
+
ttranslate crpk_40 19.8 23.6 0
|
|
235
|
+
ttranslate crpk_41 21.6 22.2 0
|
|
236
|
+
ttranslate crpk_42 21.6 23.2 0
|
|
237
|
+
ttranslate crpk_43 21.6 24.2 0
|
|
238
|
+
|
|
239
|
+
ttranslate crpk_44 18.0 24.6 0
|
|
240
|
+
ttranslate crpk_45 18.0 25.6 0
|
|
241
|
+
ttranslate crpk_46 18.0 26.6 0
|
|
242
|
+
ttranslate crpk_47 18.0 27.6 0
|
|
243
|
+
|
|
244
|
+
eval compound $lrpk brpk
|
|
245
|
+
|
|
246
|
+
# show result in 3d viewer
|
|
247
|
+
vinit View1
|
|
248
|
+
vclear
|
|
249
|
+
vsetdispmode 1
|
|
250
|
+
vrenderparams -msaa 8
|
|
251
|
+
vlight -clear
|
|
252
|
+
vlight amblight -type AMBIENT
|
|
253
|
+
vlight dirlight -type DIRECTIONAL -direction 1 -1 -2 -head 1
|
|
254
|
+
if [info exists i7_show_3dview] {
|
|
255
|
+
vdisplay case
|
|
256
|
+
vsetcolor case GRAY70
|
|
257
|
+
|
|
258
|
+
vdisplay title
|
|
259
|
+
vsetcolor title GRAY10
|
|
260
|
+
|
|
261
|
+
# board is mostly yellow (edges, triangle markers)
|
|
262
|
+
foreach f [explode board f] { vdisplay $f; vsetcolor $f B3803D }
|
|
263
|
+
# top and bottom faces are light-green (outside) and dark-green (inside)
|
|
264
|
+
vsetcolor board_4 00998C
|
|
265
|
+
vsetcolor board_5 00998C
|
|
266
|
+
vsetcolor board_12 004D54
|
|
267
|
+
vsetcolor board_14 004D54
|
|
268
|
+
|
|
269
|
+
vdisplay rpads
|
|
270
|
+
vsetcolor rpads B39966
|
|
271
|
+
|
|
272
|
+
vdisplay bpads
|
|
273
|
+
vsetcolor bpads B39966
|
|
274
|
+
|
|
275
|
+
vdisplay brpk
|
|
276
|
+
vsetcolor brpk 80664D
|
|
277
|
+
|
|
278
|
+
donly board case rpads brpk; fit
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
# make XDE document
|
|
282
|
+
catch {Close D}
|
|
283
|
+
pload OCAF XDE
|
|
284
|
+
|
|
285
|
+
NewDocument D MDTV-XCAF
|
|
286
|
+
|
|
287
|
+
SetName D [XAddShape D board 0] "Board"
|
|
288
|
+
foreach f [explode board f] { XSetColor D $f B3803D }
|
|
289
|
+
XSetColor D board_4 00998C
|
|
290
|
+
XSetColor D board_5 00998C
|
|
291
|
+
XSetColor D board_12 004D54
|
|
292
|
+
XSetColor D board_14 004D54
|
|
293
|
+
|
|
294
|
+
SetName D [XAddShape D case 0] "Case"
|
|
295
|
+
XSetColor D case GRAY70
|
|
296
|
+
|
|
297
|
+
SetName D [XAddShape D title 0] "Case title"
|
|
298
|
+
XSetColor D title GRAY10
|
|
299
|
+
|
|
300
|
+
SetName D [XAddShape D rpads 1] "Top side contact pads"
|
|
301
|
+
SetName D [XAddShape D bpads 1] "Bottom contact pads"
|
|
302
|
+
SetName D [XFindShape D bpad] "Contact pad"
|
|
303
|
+
SetName D [XFindShape D rpad] "Round pad"
|
|
304
|
+
SetName D [XFindShape D Rpad] "Big round pad"
|
|
305
|
+
SetName D [XFindShape D spad_1] "Square pad 1"
|
|
306
|
+
SetName D [XFindShape D spad_2] "Square pad 2"
|
|
307
|
+
XSetColor D rpad B39966
|
|
308
|
+
XSetColor D Rpad B39966
|
|
309
|
+
XSetColor D bpad B39966
|
|
310
|
+
XSetColor D spad_1 B39966
|
|
311
|
+
XSetColor D spad_2 B39966
|
|
312
|
+
|
|
313
|
+
SetName D [XAddShape D brpk 1] "Bottom packages"
|
|
314
|
+
SetName D [XFindShape D rpk] "Bottom package"
|
|
315
|
+
XSetColor D rpk1 GRAY70
|
|
316
|
+
XSetColor D rpk2 80664D
|
|
317
|
+
XSetColor D rpk3 GRAY70
|
|
318
|
+
|
|
319
|
+
# display in 3D Viewer
|
|
320
|
+
XDisplay -dispMode 1 D -explore
|
|
321
|
+
vfit
|
|
322
|
+
|
|
323
|
+
# save to STEP if variable i7_save_xde is defined (specifies file name)
|
|
324
|
+
if [info exists i7_save_xde] {
|
|
325
|
+
param write.surfacecurve.mode 0
|
|
326
|
+
WriteStep D $i7_save_xde
|
|
327
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Sample: creation of milling cutter
|
|
2
|
+
#Category: Modeling
|
|
3
|
+
#Title: Milling cutter
|
|
4
|
+
|
|
5
|
+
pload MODELING VISUALIZATION
|
|
6
|
+
|
|
7
|
+
# parameters
|
|
8
|
+
dset R 10. ;# outer radius
|
|
9
|
+
dset H 20. ;# height of the spiral part
|
|
10
|
+
dset a 0.5*pi ;# total angle of spiral rotation
|
|
11
|
+
|
|
12
|
+
# make profile
|
|
13
|
+
|
|
14
|
+
circle outer 0 0 0 0 0 1 R
|
|
15
|
+
circle inner 0 0 0 0 0 1 R-2
|
|
16
|
+
circle round 3 6 0 0 0 1 5
|
|
17
|
+
polyline cut -2 0 0 -2 R+1 0 0.5 R+1 0 -1 0 0 -2 0 0
|
|
18
|
+
|
|
19
|
+
proc _curvetoface {name} {
|
|
20
|
+
uplevel #0 mkedge $name $name
|
|
21
|
+
uplevel #0 wire $name $name
|
|
22
|
+
uplevel #0 mkface $name p0 $name
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
plane p0
|
|
26
|
+
_curvetoface outer
|
|
27
|
+
_curvetoface inner
|
|
28
|
+
_curvetoface round
|
|
29
|
+
mkface cut p0 cut
|
|
30
|
+
|
|
31
|
+
bcommon teeth cut round
|
|
32
|
+
bcommon teeth teeth outer
|
|
33
|
+
|
|
34
|
+
tcopy inner profile
|
|
35
|
+
set nbteeths 25
|
|
36
|
+
for {set i 0} {$i < $nbteeths} {incr i} {
|
|
37
|
+
bfuse profile profile teeth
|
|
38
|
+
trotate teeth 0 0 0 0 0 1 360./$nbteeths
|
|
39
|
+
}
|
|
40
|
+
unifysamedom profile profile
|
|
41
|
+
|
|
42
|
+
# sweep profile along curved shape
|
|
43
|
+
|
|
44
|
+
polyline sp 0 0 0 0 0 H
|
|
45
|
+
cylinder ss 0 0 0 0 0 1 1 0 0 R
|
|
46
|
+
vertex v1 R 0 0
|
|
47
|
+
vertex v2 R 0 H
|
|
48
|
+
line ll 0 0 a H
|
|
49
|
+
trim ll ll 0 sqrt(a*a+H*H)
|
|
50
|
+
|
|
51
|
+
trotate v2 0 0 0 0 0 1 180.*a/pi
|
|
52
|
+
mkedge ee ll ss v1 v2
|
|
53
|
+
wire gg ee
|
|
54
|
+
|
|
55
|
+
donly profile sp gg
|
|
56
|
+
explode profile w
|
|
57
|
+
tcopy profile_1 profile_2
|
|
58
|
+
tcopy profile_1 profile_3
|
|
59
|
+
tscale profile_1 0 0 0 1./(R-2)
|
|
60
|
+
ttranslate profile_2 0 0 H/2
|
|
61
|
+
tscale profile_2 0 0 H/2 4./(R-2)
|
|
62
|
+
ttranslate profile_3 0 0 H
|
|
63
|
+
tscale profile_3 0 0 H 3./(R-2)
|
|
64
|
+
|
|
65
|
+
mksweep sp
|
|
66
|
+
setsweep -G gg 0 0
|
|
67
|
+
addsweep profile_1
|
|
68
|
+
addsweep profile_2
|
|
69
|
+
addsweep profile_3
|
|
70
|
+
vclear
|
|
71
|
+
|
|
72
|
+
buildsweep base -S
|
|
73
|
+
|
|
74
|
+
# make a shank
|
|
75
|
+
plane p1 0 0 H 0 0 1
|
|
76
|
+
pcylinder shank p1 1.4 H
|
|
77
|
+
plane p2 0 0 H+1 0 0 1
|
|
78
|
+
pcylinder sh2 p2 1.5 H-1
|
|
79
|
+
bfuse shank shank sh2
|
|
80
|
+
bfuse cutter base shank
|
|
81
|
+
|
|
82
|
+
# check result
|
|
83
|
+
checkshape cutter
|
|
84
|
+
|
|
85
|
+
# show result
|
|
86
|
+
incmesh cutter 0.01
|
|
87
|
+
vdisplay cutter
|
|
88
|
+
vsetdispmode cutter 1
|
|
89
|
+
vrenderparams -msaa 8
|
|
90
|
+
incmesh profile_1 0.01; vdisplay profile_1
|
|
91
|
+
vfit
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Dimensions demo
|
|
2
|
+
#
|
|
3
|
+
# It shows capability of OCC to create different kinds
|
|
4
|
+
# of dimensions (linear and angular) with 2D or 3D text.
|
|
5
|
+
|
|
6
|
+
#Category: Visualization
|
|
7
|
+
#Title: Dimensions in 3d viewer
|
|
8
|
+
|
|
9
|
+
set aTopLoc [locate_data_file occ/Top.brep]
|
|
10
|
+
set aBotLoc [locate_data_file occ/Bottom.brep]
|
|
11
|
+
set aHatch [locate_data_file images/hatch_1.png]
|
|
12
|
+
|
|
13
|
+
pload MODELING VISUALIZATION
|
|
14
|
+
|
|
15
|
+
puts "Importing shapes..."
|
|
16
|
+
restore $aTopLoc a
|
|
17
|
+
restore $aBotLoc b
|
|
18
|
+
|
|
19
|
+
vinit View1 w=768 h=768
|
|
20
|
+
vclear
|
|
21
|
+
vsetdispmode 0
|
|
22
|
+
vbackground -color WHITE
|
|
23
|
+
vbottom
|
|
24
|
+
|
|
25
|
+
puts "Getting cut projection..."
|
|
26
|
+
box bb -150 -250 0 150 250 100
|
|
27
|
+
bsection bs b bb
|
|
28
|
+
bsection as a bb
|
|
29
|
+
vdisplay bs as
|
|
30
|
+
vfit
|
|
31
|
+
|
|
32
|
+
set anAEdges [explode as E]
|
|
33
|
+
set aBEbges [explode bs E]
|
|
34
|
+
|
|
35
|
+
set anArrAngle [expr 3.14 * 12.0 / 180.0]
|
|
36
|
+
|
|
37
|
+
# Form dimension names list to set parameters with vdimparam command
|
|
38
|
+
set aList {rd_1 rd_2 ad_1 ad_2 ad_3}
|
|
39
|
+
for {set i 1} {$i <= 10} {incr i} { lappend aList ld_$i }
|
|
40
|
+
|
|
41
|
+
puts "Creating dimensions..."
|
|
42
|
+
vdimension ld_1 -length -shapes bs_27 -plane xoy -color black -flyout -15
|
|
43
|
+
vdimension ld_2 -length -shapes bs_14 -plane xoy -color black -flyout 15
|
|
44
|
+
vdimension ld_3 -length -shapes bs_28 -plane xoy -color black -label right -flyout -27
|
|
45
|
+
vdimension ld_4 -length -shapes as_7 -plane xoy -color black -flyout -20
|
|
46
|
+
vdimension ld_5 -length -shapes as_28 -plane xoy -color black -flyout -15
|
|
47
|
+
vdimension ld_6 -length -shapes as_18 -plane xoy -color black -flyout 30
|
|
48
|
+
vdimension ld_7 -length -shapes bs_20 -plane xoy -color black -flyout -20
|
|
49
|
+
vdimension ld_8 -length -shapes as_42 -plane xoy -color black -flyout 55 -label right
|
|
50
|
+
vdimension ld_9 -length -shapes as_12 -plane xoy -color black -flyout 35 -label right
|
|
51
|
+
vdimension ld_10 -length -shapes as_40 -plane xoy -color black -flyout 15
|
|
52
|
+
|
|
53
|
+
vdimension rd_1 -radius -shapes bs_45 -color black -label right
|
|
54
|
+
vdimension rd_2 -radius -shapes bs_63 -color black
|
|
55
|
+
|
|
56
|
+
vdimension ad_1 -angle -shapes as_38 as_49 -color black
|
|
57
|
+
vdimension ad_2 -angle -shapes bs_24 bs_25 -color black
|
|
58
|
+
vdimension ad_3 -angle -shapes as_48 as_42 -color black
|
|
59
|
+
|
|
60
|
+
puts "Changing text and arrow parameters of dimensions..."
|
|
61
|
+
foreach i $aList {
|
|
62
|
+
vdimparam $i -text 3d sh 6 -arrowlength 4 -arrowangle $anArrAngle
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
vfit
|
|
66
|
+
|
|
67
|
+
puts "Displaying exported shapes..."
|
|
68
|
+
vdisplay -dispMode 1 a b
|
|
69
|
+
vaspects a -setmaterial steel
|
|
70
|
+
vaspects b -setmaterial bronze
|
|
71
|
+
|
|
72
|
+
puts "Clipping shapes for better view..."
|
|
73
|
+
|
|
74
|
+
vclipplane pa -set a -equation 0 0 1 0 -capping on -color GRAY90 -texName $aHatch -texScale 0.05 -0.05
|
|
75
|
+
vclipplane pb -set b -equation 0 0 1 0 -capping on -color GOLD -texName $aHatch -texScale 0.05 -0.05
|
|
76
|
+
|
|
77
|
+
vbottom
|
|
78
|
+
vrotate -0.3 -0.3 0
|
|
79
|
+
vfit
|
|
80
|
+
vzoom 1.2
|
|
81
|
+
vrenderparams -msaa 8
|
|
82
|
+
|
|
83
|
+
puts "Done."
|