Open Cascade手册(9)
- 格式:pdf
- 大小:502.20 KB
- 文档页数:11
ModelCatalog NumberParts Manualc For Technical Assistance call: 800-227-2233, Fax: 888-329-8207To Order Parts call: 888-227-2233, Fax: 888-329-0234Push/Pull 35E-PPB-Q002 R 4cascadecorporationPublicationsPART NO.DESCRIPTIONParts Manual686455Service Manual684945Operators Guide685531Operators Pocket Guide684944Installation Instructions680664Servicing Cascade Cylinders-VHS 679929Tool Catalog673964Literature Index Order FormDecalsREF QTY PART NO.DESCRIPTION685766Platen Group11685767Platen − LH21685768Platen − RH32622907u Pin428007u Rivet52622908u Spring62622897u Handleu Included in Upper Hook Assembly 688386. Reference: S-3408, S-3409, S-3410.REF QTY PART NO.DESCRIPTION 72685533u Upper Hook84685677Capscrew, M16 x 459l682858Shim (.030) 102682851Lower Hook 114667225Washer124209016Capscrew, M16 x 3513n688379Shim (.060)l As required − 2 maximum.n As required for proper adjustment.35E/45E45EREF QTY PART NO.DESCRIPTION6082715Frame Group 116050000Frame232453Fitting, 6-631686509Tube41686510Tube52768825Capscrew, M12 x 20 612680Fitting, 6-6712375Fitting, 6-684682850StopNon S/S Mounting Group ITA II682832Mounting Group-39" Wide 11682550Anchor Bracket-39" Wide 22671165Bearing Segment 32768759Setscrew 42682814Bearing547403Grease Fitting35E/45EREF QTY PART NO.DESCRIPTIONQuick-Disconnect Lower Hook Group ITA II35E/45EREF QTY PART NO.DESCRIPTION683179Lower Hook Group12678832Pin22675514Hook34683182Capscrew, M16 x 3542675515Guide35E/45EREF QTY PART NO.DESCRIPTION204644Mechanism Group 11204691Arm – Inner Secondary RH 21204692Arm – Secondary Outer RH 34683154Bushing n4l683161Shim (.030)5l683162Shim (.060)64205070Roller7l683163Shim (.030)8l683164Shim (.060)94683155Bushing n101682821Pin – Primary/Secondary Inner 11126229Washer122685661Capscrew, M8 x 14 131********Eye Pin142682822Pin – Head152205065Pin166683153Bushing n17l204532Shim (.12)182204694Arm – Outer Primary 194204533Pin – Frame204204535Bushing n214204695Pin – Primary Outer 221204604Arm – Inner Primary 231204693Arm – Secondary Outer LH 241204690Arm – Inner Secondary LH 252204696Pin – Outer262682823Pin – Rod272683165Spacer2810767961Capscrew, M8 x 162926045015Retainer u (or) 26050227Retainer uH3016047125Retainer u (or) 16050414Retainer uH3136047151Capscrew, M8 x 16 H 3237913Roll Pin Hl Quantity as required.n Included in Bushing Service Kit 205075.u Confirm part number cast on retainer.H Included in Service Kit 6051665.Cylinder Assembly35EREF QTY PART NO.DESCRIPTION582635Cylinder Assembly 11678019Nut 21564158u Seal31671047u Seal Loader Kit 41564160Piston 51562716Shell 61558626Rod 71662448u Seal 812785u O-Ring91615128u Back-Up Ring 101559696Retainer 111636853u Wiper 124559697Bearing 131559698Spacer 142604510Fitting, 6562338Cylinder Service Kitu Included in Service Kit 562338.Hydraulic Group - ITA Class IIREF QTY PART NO.DESCRIPTION6086064Hydraulic Group 11685831Hose, Twinline, 39.60 in.22683173u Hose, 15.50 in.312375u Fitting, 6-642604511u Fitting, 6-66604511Fitting, 6-6516085925Valve n62787373u Capscrew, M8 x 25n See Valve Assembly page for parts breakdown.REF QTY PART NO.DESCRIPTION72685978Hose, 19.40 in.82684956Cable Tie 94605235u Fitting, 5-6101200647u Tube 112604510Plug 121200649u Tube 131200648u Tubeu Included in Hydraulic Components Group 200581-R6.Reference: SK-5385, 5386.35E/45EGBRETValve AssemblyREF QTY PART NO.DESCRIPTION6085925Valve Assembly 116045016Relief Valve21682170Service Kit316085927Valve BodyFaceplate GroupREF QTY PART NO.DESCRIPTION6019140Faceplate Group (R3)6020440Gripper Jaw Assembly (R5) l 11206396Gripper Jaw216002134Valve316020444Gripper Cylinder, LH u416020443Gripper Cylinder, RH u546020462Collar62787373Capscrew, M8 x 20746014089Pin816002135Gripper Bar91672712Gripper Pad105680253Lockwasher, M8u See Gripper Cylinder page for parts breakdown.l Includes items 1-17.REF QTY PART NO.DESCRIPTION 115787375Capscrew, M8 x 20 122604511Fitting, 6-6132686573Bearing1426002138Hose, 315 mm 1526002139Hose, 450 mm 164617918Fitting, 4-4178669894Retaining Ring 184225346Capscrew, M16 x 60 194675620Washer2016002142Faceplate, 40 x 40 in. n 212768714Capscrew, M16 x 60n Width x height.35E/45EREF QTY PART NO.DESCRIPTION6020444Gripper Cylinder – LH 11646540w Seal21636850w Wiper312718w O-Ring412710w O-Ring51615122w Back-Up Ring616020453Shell716020461Rod81685664Retainer91685665Piston101563462Nut111563916Ring1213137Ring131663728w Piston Sealw Included in Service Kit 684827.REF QTY PART NO.DESCRIPTION6020443Gripper Cylinder – RH 11646540w Seal21636850w Wiper312718w O-Ring412710w O-Ring51615122w Back-Up Ring616020452Shell716020461Rod81685664Retainer91685665Piston101563462Nut111563916Ring1213137Ring131663728w Piston Sealw Included in Service Kit 684827.Do you have questions you need answered right now? Call your nearest Cascade Parts Department. Visit us online at Cascade CorporationU.S. Headquarters2201 NE 201stFairview, OR 97024-9718 Tel: 800-CASCADE (227-2233) FAX: 888-329-8207Cascade Canada Inc.5570 Timberlea Blvd.Mississauga, OntarioCanada L4W-4M6Tel: 905-629-7777FAX: 905-629-7785Cascade GmbHNiederwippekühl 158579 SchalksmühleGermanyTel: 02355-50900FAX: 02355-509020Cascade FinlandA. Petreliuksenkatu 301370 VantaaFinlandTel: 09-8361925FAX: 09-8361935Cascade N.V.Benelux Sales and Service Damsluisweg 56PO Box 30091300 El AlmereThe NetherlandsTel: 036-5492950FAX: 036-5492974Cascade Kenhar Ltd.3 Kelbrook RoadParkhouse Ind. EstateOpenshaw,Manchester M11 2DDEnglandTel: 0800-243015FAX: 0161-4384055Sales ScotlandMacade Systems Ltd.18 Melford RoadRighead Ind. EstateBellshill ML4 3LRScotlandTel: 01698-845777FAX: 01698-845888Cascade (Africa) Pty. Ltd.PO Box 625, Isando 160060A Steel RoadSparton, Kempton ParkSouth AfricaTel: 27-11-975-9240FAX: 27-11-394-1147Cascade Scandinavia AB Hammarvägen 10PO Box 124S-56723 Vaggeryd SwedenTel: 039-336950FAX: 039-336959Cascade FranceS.A.R.L. MHP1D Rue De Charaintru BP 18,91360 Epinay-Sur-OrgeFranceTel: 01-6454-7500FAX: 01-6454-7501Cascade Hispania S.A.Carrer 5, Sector CZona Franca DuaneraPoligono de la Zona Franca08040 Barcelona, SpainTel: 93-264-07-30FAX: 93-264-07-31Cascade Italia S.R.L.Via Dell’Artigianato 137050 Vago di Lavagno (VR)ItalyTel: 39-045-8989111FAX: 39-045-8989160Movimenta Lda. Parque IndustrialVale do Alecrim, Lote 108 2950-403 Palmela PortugalTel: 351-212387340 FAX: 351-212387349Sales SwitzerlandFahrzeugbedarf8810, HorgenSwitzerlandTel: 01-7279797FAX: 01-7279798Sales PolandTargowa 35/6103-728 WarszawaTel: 022-619 00 49FAX: 022-619 00 49Mobile Tel: 0501-27 29 55Sales RussiaEMCG Material HandlingEquipmentMoscowTel: 095-795-2400FAX: 095-795-2475Email:************Cascade Japan Ltd. 5-5-41,Torikai Kami Settsu, Osaka Japan, 566Tel: 81-726-53-3490 FAX: 81-726-53-3497Cascade Korea121B 9L Namdong Ind.Complex, 691-8 Gojan-DongNamdong-KuInchon, 405-310 KoreaTel: 82-32-821-2051FAX: 82-32-821-2055Cascade Australia1445 Ipswich RoadRocklea, QLD 4107AustraliaTel: 1-800-227-223FAX: 617-3373-7333Cascade New Zealand15 Ra Ora DriveEast Tamaki, AucklandNew ZealandTel: 64-9-273-9136FAX: 64-9-273-9137Cascade-XiamenNo. 668 Yangguang Rd. Xinyang Industrial Zone Haicang, Xiamen City Fujian ProvinceP.R. China 361026 Tel: 86-592-651-2500 FAX: 86-592-651-2571Sunstream IndustriesPte Ltd.No. 3 Tuas Link 12263SingaporeTel: 65-6863-3488FAX: 65-6863-1368Cascade do BrasilDistribuidora de Garrase Garfos LTDARua João Guerra, 134Macuco, Santos - SPBrasil 11015-130Tel: 55-13-2105-8800Fax: 55-13-2105-8899c。
前言很久就想这篇东西,可一直懒于动脑且为一些俗事烦恼,所以才拖到现在才动笔把我上学期间一篇论文整理一下,仅供参考。
我分成几段来写,如果想看懂这篇文章,那首先要了解每段之前的关键词,不懂的可以在网上搜一下。
然后还有看这篇文章的时候希望你能按自己的需要来看,有很多是写给自己看的,你只挑自己有用的看就行了,省得到时候埋怨我浪费你宝贵的时间,我这人写东西不行,尽量写的有条理,尽量吧。
需要程序的:zhangyua@第1章意义,它是三维造型软件的内核、基础。
关键词:三维造型软件、虚拟现实技术、仿真技术、OpenGL、几何内核系统、布尔操作首先,做什么事情都要有意义,因此我先说明一下Open CASCADE到底是个什么类型的工具,使用这个工具是否对你将要完成的目标有帮助。
如果有帮助,那么你可以继续往下看它的具体用法;如果没有,那么你就应该按照你的目标继续寻找实现目标的手段,不用把时间浪费在这篇文章上;如果你清楚了Open CASCADE的这一工具是干什么用的就可以跳过意义直接看下一章。
我先说一下我对这个工具的理解,然后会贴一些网上对这个工具的说明。
Open CASCADE是一款三维造型软件的内核系统,也就是制作三维造型软件的工具。
那何为三维造型软件呢?其实市面上已经有很多这样的软件了,比如说PRO/E、UE、Solid Edge、Catia、国内还自主研发的金银花系统(好象叫这个名字)以上这些大多都是用于工业上的,3DMAX、VRML(这里要说明一下VRML其实是一款适合网络的三维造型语言,应属语言系列,和HTML语言类似,不太附和三维造型软件的标准)也是三维造型软件,当然还有很多很多这种类型的软件,就不做过多介绍。
三维造型软件,可以在电脑上如实地(尺寸、颜色、材质等)搭建起一个虚拟的模型,这些模型可以用于工业设计、艺术设计、装修设计等等等一系列的虚拟现实技术相关的行业,也可以用来做一些仿真实验的模型构建。
可能有很多人都已经用过一款或两款三维造型软件,但是你在用的时候想没想过三维造型软件是怎么做出来的呢?它的底层是由什么支持的?它是由两部分支持的,一是硬件支持,如显卡,这个我们不讨论;二是软件,作为软件,我猜想(注意是我猜的,如有疑问请查实)它也是可以分成两个部分,一是硬件驱动的标准体系(请关注OpenGL),二就是几何内核系统。
TutorialMy First ApplicationVersion 6.3 / September 20082 Project OverviewCopyright © 2008, by Open CASCADE S.A.S.PROPRIETARY RIGHTS NOTICE: All rights reserved. No part of this material may be reproduced or transmitted in any form or by any means, electronic, mechanical, or otherwise, including photocopying and recording or in connection with any information storage or retrieval system, without the permission in writing from Open CASCADE S.A.S.The information in this document is subject to change without notice and should not be construed as a commitment by Open CASCADE S.A.S. Open CASCADE S.A.S. assures no responsibility for any errors that may appear in this document.The software described in this document is furnished under a license and may be used or copied only in accordance with the terms of such a license.CAS.CADE and Open CASCADE are registered trademarks of Open CASCADE S.A.S. Other brand or product names are trademarks or registered trademarks of their respective holders.NOTICE FOR USERS:This User Guide is a general instruction for Open CASCADE study. It may be incomplete and even contain occasional mistakes, particularly in examples, samples, etc. Open CASCADE S.A.S. bears no responsibility for such mistakes. If you find any mistakes or imperfections in this document, or if you have suggestions for improving this document, please, contact us and contribute your share to the development of Open CASCADE Technology: bugmaster@Tour Opus 1277, Esplanade du Général de Gaulle92914 PARIS LA DEFENSEFRANCEProject Overview3Table of Contents1.PROJECT OVERVIEW (4)1.1.P REREQUISITES (4)1.2.T HE PROJECT (4)1.3.P ROJECT S PECIFICATIONS (4)2.BUILDING THE PROFILE (6)2.1.D EFINING S UPPORT P OINTS (6)2.2.P ROFILE:D EFINING THE G EOMETRY (7)2.3.P ROFILE:D EFINING THE T OPOLOGY (8)2.4.P ROFILE:C OMPLETING THE P ROFILE (10)3.BUILDING THE BODY (12)3.1.P RISM THE P ROFILE (12)3.2.A PPLYING F ILLETS (13)3.3.A DDING THE N ECK (15)3.4.C REATING A H OLLOWED S OLID (16)4.BUILDING THE THREADING (19)4.1.C REATING S URFACES (19)4.2.D EFINING 2D C URVES (19)4.3.B UILDING E DGES AND W IRES (23)4.4.C REATING T HREADING (24)5.BUILDING THE RESULTING COMPOUND (26)6.APPENDIX (27)4 Project Overview1. Project Overview This tutorial will teach you how to use Open CASCADE services to model a 3D object. The purpose of this tutorial is not to describe all Open CASCADE classes but to help you to start thinking in terms of the Open CASCADE tool.1.1. PrerequisitesThis tutorial assumes that you have experience in using and setting up C++.From a programming standpoint, Open CASCADE is designed to enhance your C++ tools with high performance modeling classes, methods and functions. The combination of all these resources will allow you to create substantial applications.1.2. The projectTo illustrate the use of classes provided in the 3D geometric modeling toolkits, you will create a bottle as shown:In the tutorial we will create, step-by-step, a function that will model a bottle as shown above. You will find the complete source code of this tutorial, including the very function MakeBottle in the distribution of Open CASCADE. The function body is provided in the file Tutorial/src/MakeBottle.cxx.1.3. Project SpecificationsWe first define the bottle specifications as follows:Object Parameter ParameterName Parameter ValueBottle height MyHeight70mm Bottle width MyWidth50mm Bottle thickness MyThickness30mmProject Overview5In addition, we decide that the bottle’s profile will be centered on the origin of the global Cartesian coordinate system.This modeling requires four steps:•build the bottle’s Profile•build the bottle’s Body• build the Threading on the bottle’s neck•build result compound6 Building the Profile2. Building the Profile2.1. Defining Support PointsTo create the bottle’s profile, you first create characteristic points with their coordinates as shown below in the (XOY) plane. These points will be the supports that define the geometry of the profile.There are two classes to describe a 3D Cartesian point from its X, Y and Z coordinates in Open CASCADE:•the primitive geometric gp_Pnt class• the transient Geom_CartesianPoint class manipulated by a handleA handle is a type of smart pointer that provides automatic memory management.To choose the best class for this application, consider the following:•gp_Pnt is manipulated by value. Like all objects of its kind, it will have limited lifetime.•Geom_CartesianPoint is manipulated by a handle and may have multiple references and long lifetime.Since all the points you will define are only used to create the profile’s curves, an object with a limited lifetime will do. Choose the gp_Pnt class.To instantiate a gp_Pnt object, just specify the X, Y, and Z coordinates of the points in the global cartesian coordinate system:gp_Pnt aPnt1(-myWidth / 2. , 0 , 0);gp_Pnt aPnt2(-myWidth / 2. , -myThickness / 4. , 0);gp_Pnt aPnt3(0 , -myThickness / 2. , 0);gp_Pnt aPnt4(myWidth / 2. , -myThickness / 4. , 0);gp_Pnt aPnt5(myWidth / 2. , 0 , 0);If you had decided to use the Geom_CartesianPoint class, the syntax would have been slightly different. All objects manipulated by a handle must use the standard C++ operator new and are built as follows:Handle(Geom_CartesianPoint) aPnt1 = newGeom_CartesianPoint(-myWidth / 2. , 0 , 0);Building the Profile7 Once your objects are instantiated, you may need to apply methods to them. Here again, syntax is the same as in C++. For example, to get the X coordinate of a point:gp_Pnt aPnt1(0,0,0);Handle(Geom_CartesianPoint) aPnt2 =new Geom_CartesianPoint(0 , 0 , 0);Standard_Real xValue1 = aPnt1.X();Standard_Real xValue2 = aPnt2->X();2.2. Profile: Defining the GeometryWith the help of the previously defined points, you can compute a part of the bottle’s profile geometry. As shown in the figure below, it will consist of two segments and one arc.To create such entities, you need a specific data structure, which implements 3D geometric objects. This can be found in the Open CASCADE Geom package.An Open CASCADE package is defined as a group of classes, which have the same behavior or belong to the same structure. Open CASCADE classes have names that start with the name of the package they belong to. For example, Geom_Line and Geom_Circle classes belong to the Geom package. The Geom package implements 3D geometric objects: elementary curves and surfaces are provided as well as more complex ones (such as Bezier and BSpline).However, the Geom package provides only the data structure of geometric entities. You can directly instantiate classes belonging to Geom, but it is easier to compute elementary curves and surfaces by using the GC package.This is because the GC provides two algorithm classes which are exactly what is required for our profile:• Class GC_MakeSegment to create a segment. One of its constructors allows you to define a segment out of two points P1 and P2.• Class GC_MakeArcOfCircle to create an arc of a circle. A very useful constructor specifies that an arc can be built from two points P1 and P3 and going through P2.Both of these classes return a Geom_TrimmedCurve manipulated by a handle. This entity represents a base curve, which is limited between two of its parameter values. For example, circle C is parameterized between 0 and 2PI. If you need to create a quarter of a circle, you create a G eom_TrimmedCurve on C limited between 0 and PI/2.8 Building the ProfileHandle(Geom_TrimmedCurve) aArcOfCircle =GC_MakeArcOfCircle(aPnt2,aPnt3 ,aPnt4);Handle(Geom_TrimmedCurve) aSegment1 = GC_MakeSegment(aPnt1 , aPnt2);Handle(Geom_TrimmedCurve) aSegment2 = GC_MakeSegment(aPnt4 , aPnt5);All GC classes provide a casting method to obtain a result automatically with a function-like call. You may use these classes more safely by using the IsDone and Value methods. For example:GC_MakeSegment mkSeg (aPnt1 , aPnt2);Handle(Geom_TrimmedCurve) aSegment1;if(mkSegment.IsDone()){aSegment1 = mkSeg.Value();...}2.3. Profile: Defining the TopologyYou have created the support geometry of one part of the profile but these curves are independent with no relations between each other.To simplify the modeling, it would be right to manipulate these three curves as a single entity.This can be done by using the Open CASCADE topological data structure described in the TopoDS package: it defines relationships between geometric entities which can be linked together to represent complex shapes.Each object of the TopoDS package, inheriting from the TopoDS_Shape class, describes a topological shape as described below:Shape Open CASCADE Class DescriptionVertex TopoDS_Vertex Zero dimensional shape corresponding to apoint in geometry.Edge TopoDS_Edge Single dimensional shape corresponding to acurve and bounded by a vertex at eachextremity.Wire TopoDS_Wire Sequence of edges connected by vertices.Face TopoDS_Face Part of a surface bounded by a closed wire.Shell TopoDS_Shell Set of faces connected by edges.Solid TopoDS_Solid Part of 3D space bounded by Shells.Building the Profile9 CompSolid TopoDS_CompSolid Set of solids connected by their faces.Compound TopoDS_Compound Set of any other shapes described above.Referring to the previous table, you can see that, to build the profile, you will create: •Three edges out of the previously computed curves.•One wire with these edges.However, the TopoDS package provides only the data structure of the topological entities. Algorithm classes available to compute standard topological objects can be found in the BRepBuilderAPI package.To create an edge, you use the BRepBuilderAPI_MakeEdge class with the previously computed curves:TopoDS_Edge aEdge1 = BRepBuilderAPI_MakeEdge(aSegment1);TopoDS_Edge aEdge2 = BRepBuilderAPI_MakeEdge(aArcOfCircle);TopoDS_Edge aEdge3 = BRepBuilderAPI_MakeEdge(aSegment2);In Open CASCADE, you can create edges in several ways. One possibility is to create an edge directly from two points, in which case the underlying geometry of this edge is a line, bounded by two vertices being automatically computed from the two input points. For example, aEdge1 and aEdge3 could have been computed more simply:TopoDS_Edge aEdge1 = BRepBuilderAPI_MakeEdge(aPnt1 , aPnt3);TopoDS_Edge aEdge2 = BRepBuilderAPI_MakeEdge(aPnt4 , aPnt5);To connect the edges, you need to create a wire with the BRepBuilderAPI_MakeWire class. There are two ways of building a wire with this class:•directly from one to four edges•by adding other wire(s) or edge(s) to an existing wire (this is explained later in this tutorial) When building a wire from less than four edges, as in the present case, you can use the constructor10 Building the Profiledirectly as follows:TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(aEdge1 , aEdge2 , aEdge3);2.4. Profile: Completing the ProfileOnce the first part of your wire is created you need to compute the complete profile. A simple way to do this is to:•compute a new wire by reflecting the existing one.•add the reflected wire to the initial one.To apply a transformation on shapes (including wires), you first need to define the properties of a 3D geometric transformation by using the gp_Trsf class. This affinity transformation can be a translation, a rotation, a scale, a reflection or a combination of these.In our case, we need to define a reflection with respect to the X axis of the global coordinate system. An axis, defined with the gp_Ax1 class, is built out of a point and has a direction (3D unitary vector). There are two ways to define this axis.The first way is to define it from scratch, using its geometric definition:•X axis is located at (0 , 0 , 0) - use the gp_Pnt class.•X axis direction is (1 , 0 , 0) - use the gp_Dir class. A gp_Dir instance is created out of its X, Y and Z coordinates.gp_Pnt aOrigin(0 , 0 , 0);gp_Dir xDir(1 , 0 , 0);gp_Ax1 xAxis(aOrigin , xDir);The second and simplest way is to use the geometric constants defined in the gp package (origin, main directions and axis of the global coordinate system). To get the X axis, just call the gp::OX method:gp_Ax1 xAxis = gp::OX();Building the Profile11 As previously explained, the property of a 3D geometric transformation is defined with the gp_Trsf class. There are two different ways to use this class:•by defining a transformation matrix from scratch•by using the appropriate methods corresponding to the required transformation (SetTranslation for a translation, SetMirror for a reflection, etc.): the matrix is automatically computed.Since the simplest approach is always the best one, you should use the SetMirror method with the axis as the center of symmetry.gp_Trsf aTrsf;aTrsf.SetMirror(xAxis);You now have all necessary data to apply the transformation with the BRepBuilderAPI_Transform class by specifying:•the shape on which the transformation must be applied.•the geometric transformationBRepBuilderAPI_Transform aBRepTrsf(aWire , aTrsf);BRepBuilderAPI_Transform does not modify the nature of the shape: the result of the reflected wire remains a wire. But the function-like call or the BRepBuilderAPI_Transform::Shape method returns a TopoDS_Shape object:TopoDS_Shape aMirroredShape = aBRepTrsf.Shape();What you need is a method to consider the resulting reflected shape as a wire. The TopoDS global functions provide this kind of service by casting a shape into its real type. To cast the transformed wire, use the TopoDS::Wire method.TopoDS_Wire aMirroredWire = TopoDS::Wire(aMirroredShape);The bottle’s profile is almost finished. You have created two wires: aWire and aMirroredWire. You need to concatenate them to compute a single shape. To do this, you use the BRepBuilderAPI_MakeWir e class as follows:•create an instance of BRepBuilderAPI_MakeWire.•add all edges of the two wires by using the Add method on this object.BRepBuilderAPI_MakeWire mkWire;mkWire.Add(aWire);mkWire.Add(aMirroredWire);TopoDS_Wire myWireProfile = mkWire.Wire();12 Building the Body3. Building the Body3.1. Prism the ProfileTo compute the main body of the bottle, you need to create a solid shape. The simplest way is to use the previously created profile and to sweep it along a direction: the Prism Open CASCADE functionality is the most appropriate. It accepts a shape and a direction as input and generates a new shape according to the following rules:Shape GeneratesVertex EdgeEdge FaceWire ShellFace SolidShell Compound of SolidsYour current profile is a wire. Referring to the Shape/Generates table, you need to compute a face out of its wire to generate a solid.To create a face, use the BRepBuilderAPI_MakeFace class. As previously explained, a face is a part of a surface bounded by a closed wire. Generally, BRepBuilderAPI_MakeFace computes a face out of a surface and one or more wires.When the wire lies on a plane, the surface is automatically computed.TopoDS_Face myFaceProfile = BRepBuilderAPI_MakeFace(myWireProfile);The BRepPrimAPI package provides all the classes to create topological primitive constructions: boxes, cones, cylinders, spheres, etc. Among them is the BRepPrimAPI_MakePrism class. AsBuilding the Body13specified above, this class is defined by:•the basis shape to sweep• a vector for a finite prism or a direction for finite and infinite prismsYou want the solid to be finite, swept along the Z axis and to be myHeight height. The vector, defined with the gp_Vec class on its X, Y and Z coordinates, is:gp_Vec aPrismVec(0 , 0 , myHeight);All the necessary data to create the main body of your bottle is now available. Just apply the BRepPrimAPI_MakePrism class to compute the solid:TopoDS_Shape myBody = BRepPrimAPI_MakePrism(myFaceProfile , aPrismVec);3.2. Applying FilletsThe edges of the bottle’s body are very sharp. To replace them by rounded faces, you use the Fillet functionality of Open CASCADE.Depending on their location, fillets can be very complex - for example, they can follow linear or specific evolution laws between vertices of an edge - but for our purposes, you will simply specify that fillets must be:•applied on all edges of the shape•have a radius of myThickness / 12To apply fillets on the edges of a shape, you use the BRepFilletAPI_MakeFillet class. This class is normally used as follows:•Specify the shape to be filleted in the BRepFilletAPI_MakeFillet constructor.14 Building the Body•Add the fillet descriptions (an edge and a radius) using the Add method (you can add as many edges as you need).•Ask for the resulting filleted shape with the Shape method.BRepFilletAPI_MakeFillet mkFillet(myBody);To add the fillet description, you need to know the edges belonging to your shape. The best solution is to explore your solid to retrieve its edges. This kind of functionality is provided with the TopExp_Explorer class, which explores the data structure described in a TopoDS_Shape and extracts the sub-shapes you specifically need.Generally, this explorer is created by providing the following information:•the shape to explore•the type of sub-shapes to be found. This information is given with the TopAbs_ShapeEnum enumeration.TopExp_Explorer aEdgeExplorer(myBody , TopAbs_EDGE);An explorer is usually applied in a loop by using its three main methods:•More to know if there are more sub-shapes to explore.•Current to know which is the currently explored sub-shape.•Next to move onto the next sub-shape to explore (used only if the More method returns true).while(aEdgeExplorer.More()){TopoDS_Edge aEdge =TopoDS::Edge(aEdgeExplorer.Current());//Add edge to fillet algorithm...aEdgeExplorer.Next();}In the explorer loop, you have found all the edges of the bottle shape. Each one must then be added in the BRepFilletAPI_MakeFillet instance with the Add method. Do not forget to specify the radius of the fillet along with it.mkFillet.Add(myThickness / 12. , aEdge);Once this is done, you perform the last step of the procedure by asking for the filleted shape.myBody = mkFillet.Shape();Building the Body153.3. Adding the NeckTo add a neck to the bottle, you will create a cylinder and fuse it to the body. The cylinder is to be positioned on the top face of the body with a radius of myThickness / 4. and a height of myHeight / 10.To position the cylinder, you need to define a coordinate system with the gp_Ax2 class defining a right-handed coordinate system from a point and two directions - the normal and the X direction (the Y direction is computed from these two).The center of the top face being, in the global coordinate system, (0 , 0 , myHeight) and its normal on the Z axis, your local coordinate system can be defined as follows:gp_Pnt neckLocation(0 , 0 , myHeight);gp_Dir neckNormal = gp::DZ();gp_Ax2 neckAx2(neckLocation , neckNormal);To create a cylinder, use another class from the primitives construction package: the BRepPrimAPI_MakeCylinder class. The information you must provide is:•the coordinate system where the cylinder will be located•the radius and heightStandard_Real myNeckRadius = myThickness / 4.;Standard_Real myNeckHeight = myHeight / 10;TopoDS_Shape myNeck = BRepPrimAPI_MakeCylinder(neckAx2 ,myNeckRadius , myNeckHeight);You now have two separate parts: a main body and a neck that you need to fuse together.The BRepAlgoAPI package provides services to perform boolean operations between shapes, and especially: common (boolean intersection), cut (boolean subtraction) and fuse (boolean union).Use BRepAlgoAPI_Fuse to fuse the two shapes:16 Building the BodymyBody = BRepAlgoAPI_Fuse(myBody , myNeck);3.4. Creating a Hollowed SolidSince a real bottle is used to contain liquid material, you should now create a hollowed solid from the bottle’s top face.In Open CASCADE, a hollowed solid is called a Thick Solid and is internally computed as follows: •Remove one or more faces from an initial solid to obtain the first wall W1 of the hollowed solid.•Create a parallel wall W2 from W1 at a distance D. If D is positive, W2 will be outside the initial solid, otherwise it will be inside.•Compute a solid from the two walls W1 and W2.To compute a thick solid, you create an instance of the BRepOffsetAPI_MakeThickSolid class by giving the following information:•The shape, which must be hollowed.•The tolerance used for the computation (tolerance criterion for coincidence in generated shapes).•The thickness between the two walls W1 and W2 (distance D).•The face(s) to be removed from the original solid to compute the first wall W1.The challenging part in this procedure is to find the face to remove from your shape - the top face of the neck, which:•has a plane surface as underlying geometry•is the highest face (in Z coordinates) of the bottleTo find the face with such characteristics, you will once again use an explorer to iterate on all the bottle’s faces to find the appropriate one.Building the Body17 for(TopExp_Explorer aFaceExplorer(myBody , TopAbs_FACE) ;aFaceExplorer.More() ; aFaceExplorer.Next()){TopoDS_Face aFace = TopoDS::Face(aFaceExplorer.Current());TopoDS_Face aFace = TopoDS::Face(aFaceExplorer.Current());}For each detected face, you retrieve its surface. You then need a tool to access the geometric properties of the shape: use the BRep_Tool class. The most commonly used methods of this class are: •Surface to access the surface of a face•Curve to access the 3D curve of an edge•Point to access the 3D point of a vertexHandle(Geom_Surface) aSurface = BRep_Tool::Surface(aFace);As you can see, the BRep_Tool::Surface method returns an instance of the Geom_Surface class manipulated by a handle. However, the Geom_Surface class does not provide information about the real type of the object aSurface, which could be an instance of Geom_Plane, Geom_CylindricalSurface, etc.All objects manipulated by handle, like Geom_Surface, inherit from the Standard_Transient class which contains two very useful methods concerning types:•DynamicType to know the real type of the object•IsKind to know if the object inherits from one particular typeDynamicType returns the real type of the object, but you need to compare it with the existing known types to determine whether aSurface is a plane, a cylindrical surface or some other type.To compare a given type with the type you seek, use the STANDARD_TYPE macro, which returns the type of a class:if(aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)){...}If this comparison is true, you know that the aSurface real type is Geom_Plane. You can then convert it from Geom_Surface to Geom_Plane by using another useful function from Standard_Transient: the DownCast method. As its name implies, this static method is used to downcast objects to a given type with the following syntax:Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(aSurface); Remember that the goal of all these conversions is to find the highest face of the bottle lying on a plane. Suppose that you have these two global variables:18 Building the BodyTopoDS_Face faceToRemove;Standard_Real zMax = -1;You can easily find the plane whose origin is the biggest in Z knowing that the location of the plane is given with the Geom_Plane::Location method. For example:gp_Pnt aPnt = aPlane->Location();Standard_Real aZ = aPnt.Z();if(aZ > zMax){zMax = aZ;faceToRemove = aFace;}You have now found the top face of the neck. Your final step before creating the hollowed solid is to put this face in a list. Since more than one face can be removed from the initial solid, the BRepOffsetAPI_MakeThickSolid constructor takes a list of faces as arguments.Open CASCADE provides many collections for different kind of objects: TColGeom package for collections of objects from Geom package, TColgp package for collections of objects from gp packages, etc.The collection for shapes can be found in the TopTools package. As BRepOffsetAPI_MakeThickSolid requires a list, use the TopTools_ListOfShape class.TopTools_ListOfShape facesToRemove;facesToRemove.Append(faceToRemove);All the necessary data is now available so you can create your hollowed solid by calling the BRepOffsetAPI_MakeThickSolid constructor:MyBody = BRepOffsetAPI_MakeThickSolid(myBody , facesToRemove ,-myThickness / 50 , 1.e-3);Building the Threading194. Building the Threading4.1. Creating SurfacesUp to now, you have learned how to create edges out of 3D curves.You will now learn how to create an edge out of a 2D curve and a surface.To learn this aspect of Open CASCADE, you will build helicoidal profiles out of 2D curves on cylindrical surfaces. The theory is more complex than in previous steps, but applying it is very simple.As a first step, you compute these cylindrical surfaces. You are already familiar with curves of the Geom package. Now you can create a Geom_CylindricalSurface cylindrical surface using: • a coordinate system• a radiusUsing the same coordinate system neckAx2 used to position the neck, you create two cylindrical surfaces Geom_CylindricalSurface with the following radius:Notice that one of the cylindrical surfaces is smaller than the neck. There is a good reason for this: after the thread creation, you will fuse it with the neck. So, we must make sure that the two shapes remain in contact.Handle(Geom_CylindricalSurface) aCyl1 = newGeom_CylindricalSurface(neckAx2 , myNeckRadius * 0.99);Handle(Geom_CylindricalSurface) aCyl2 = newGeom_CylindricalSurface(neckAx2 , myNeckRadius * 1.05);4.2. Defining 2D CurvesTo create the neck of the bottle, you made a solid cylinder based on a cylindrical surface. You will create the profile of threading by creating 2D curves on such a surface.All geometries defined in the Geom package are parameterized. This means that each curve or surface from Geom is computed with a parametric equation.A Geom_CylindricalSurface surface is defined with the following parametric equation:20 Building the ThreadingP(U , V) = O + R * (cos(U) * xDir + sin(U) * yDir) + V * zDir , where :•P is the point of parameter (U, V).•O , xDir, yDir and zDir are respectively the origin, the X direction, Y direction and Z direction of the cylindrical surface local coordinate system.•R is the radius of the cylindrical surface.•U range is [0 , 2PI] and V is infinite.The advantage of having such parameterized geometries is that you can compute, on any (U, V) parameter of the surface:•the related point•the derivative vectors of order 1, 2 to N at this point•more pertinent dataThere is another advantage of these parametric equations: you can consider a surface as a 2D parametric space defined with a (U, V) coordinate system. For example, consider the parametric ranges of the neck’s surface:Suppose that you create a 2D line on this parametric (U, V) space and compute its 3D parametric curve. Depending on the line definition, results are as follows:Case Parametric Equation Parametric CurveU = 0P(V) = O + V * zDir Line parallel to the Z directionV = 0P(U) = O + R * (cos(U) * xDir + sin(U) * yDir)Circle parallel to the (O, X, Y) planeU != 0 V != 0P(U , V) = O + R * (cos(U) * xDir + sin(U) *yDir) + V * zDirHelicoidal curve describing the evolution of height and angleon the cylinder。
目录更多教程请到/hoya5121/category/556157.aspx 1. 项目概览 (4)1.1. 先决条件 (4)1.2. 项目 (4)1.3. 项目说明 (4)2. 技术描述 (6)2.1. 点 (6)2.2. 几何 (7)2.3. 拓扑 (8)2.4. 完整描述 (10)3. 构建主体 (12)3.1. 柱体 (12)3.2. 倒圆角 (13)3.3. 瓶颈 (15)3.4. 空洞 (16)4. 构建螺纹 (19)4.1. 创建表面 (19)4.2. 2D曲线 (19)4.3. 边框 (23)4.4. 螺纹 (24)5. 组合部件 (26)6. 附录 (27)1. 项目概览这个教程将教你使用OCC建立3D模型。
这个教程的目的不是描述所有的OCC类,而是让你开始思考OCC这个工具。
1.1.先决条件这个教程假设你已经有了C++的经验。
因为OCC是一个用C++设计的高性能建模库。
这样的组合将使你能够创建健壮的应用程序。
1.2. 项目下图是使用这个3D几何建模库提供的方法创建的一个瓶子:本教程将一步一步的教你创建这样一个瓶子。
你也可以在OCC安装目录中找到教程的源码(Tutorial/src/MakeBottle.cxx.)1.3.项目说明瓶子的详细参数参数参数名称参数值瓶高MyHeight 70mm瓶宽MyWidth 50mm瓶厚MyThickness 30mm另外我们将采用笛卡尔坐标系的原点做为瓶子的中心建立这个模型需要的四个步骤• 构建瓶子的轮廓• 构建瓶子的主体• 构建瓶颈上的螺纹• 组合部件2. 描述2.1. 点创建瓶子轮廓,首先要在XOY平面上创建特征点(下图)。
这些点将用来定义几何体的轮廓。
在OCC里有2个类可以用来描述3D坐标点:• gp_Pnt 类• Geom_CartesianPoint 类(句柄操作)这里句柄是一种提供自动内存管理的智能指针。
如何选择最合适类,考虑下列因素:• gp_Pnt 通过值操作。
opencascade 手册OpenCascade手册OpenCascade是一套面向CAD/CAE应用程序开发的开源工具包。
它提供了丰富的几何建模功能和数据交换能力,允许开发人员构建高度灵活和可扩展的CAD/CAE应用。
1. 简介OpenCascade是一个基于C++的开源工具包,旨在提供一套强大的几何建模功能。
它由法国的OpenCascade公司开发,并于1999年首次发布。
OpenCascade使用B-样条曲线和曲面来表示几何实体,并提供了一系列操作和算法来实现对这些实体的操作和处理。
2. 功能特点OpenCascade提供了丰富的几何建模功能,包括创建、编辑和操作各种几何实体,如点、线、圆、椭圆、曲线、曲面、体等。
它支持实体的几何和拓扑属性,如位置、旋转、缩放、倾斜、厚度、颜色等。
此外,OpenCascade还支持各种几何运算,如裁剪、补丁、布尔运算、偏差、投影等。
3. 应用领域OpenCascade广泛应用于CAD/CAE领域,包括计算机辅助设计、计算机辅助工程、工业设计等。
它被用于开发各种CAD软件,如CATIA、SolidWorks、AutoCAD等,以及模拟和仿真软件,如Ansys、Simulink等。
4. 使用方法使用OpenCascade进行几何建模需要以下步骤:(1) 导入OpenCascade库。
(2) 创建几何实体,如点、线、曲线等。
(3) 进行几何操作,如裁剪、布尔运算等。
(4) 导出生成的几何实体。
以下是一个简单的示例代码,演示了如何使用OpenCascade创建一个三维立方体并导出到文件:```#include <TopoDS.hxx>#include <BRepPrimAPI_MakeBox.hxx>#include <BRepTools.hxx>int main(){TopoDS_Shape shape = BRepPrimAPI_MakeBox(10, 10, 10).Shape();BRepTools::Write(shape, "cube.brep");return 0;}```在这个示例中,我们使用`BRepPrimAPI_MakeBox`类创建了一个10x10x10的立方体,并使用`BRepTools::Write`函数将生成的几何实体导出到文件"cube.brep"。
ModelCatalog NumberParts Manualc For Technical Assistance call: 800-227-2233, Fax: 888-329-8207To Order Parts call: 888-227-2233, Fax: 888-329-0234Integral Sideshifter20R84512cascadecorporation20RREF QTY PART NO.DESCRIPTION82364Integral Sideshifter 116552249Outer Frame Weldment24424115Lube Fitting31763052Capscrew, M6 x 2041680253Lockwasher, M8526405584Capscrew, M12 x 1662787385Lockwasher, M12716552257Carriage Weldment826526843Upper Bearing926528277Lower Bearing 1016552539Lower Hook114768812Capscrew, M10 x 50 124680030Lockwasher, M10 1326524162Retainer1426528364Cup Retainer 1586405505Capscrew, M6 x 14 168678993Lockwasher, M6 1716528362Rod1816529268O-Ring1916407252Dowel Pin 2026528119Rod Wiper 2126800368Rod Seal222616650O-Ring2316552491Valve Assembly 242768685Capscrew, M6 x 45 252777915Fitting, SAE 4 – 8 mm L-Series 264777915Fitting, SAE 4 – 8 mm L-Series 2726528126Cylinder Assembly 2816552536Tube2916552536Tube3026530868Hose, 235 mm 3126530869Hose, 295 mm 3216552263Lower Bar3326407319Pin3426064636Capscrew, M8 x 2526528366Rod Assembly16529147Seal KitIncluded in Rod Assembly 6528366.Included in Seal Kit 6529147.See Valve Assembly page for parts breakdown.See Cylinder Assembly page for parts breakdown. Reference: 20R84512, SK-24493.Valve AssemblyREF QTY DESCRIPTIONPART NO.6552491Valve Assembly 116552493Valve Body216527938Counterbalance Valve Cartridge 326552492Flow Divider Valve 42601676Fitting 52652841664777915Fitting 90°7Fitting 22645NutCylinder AssemblyREF QTY PART NO.DESCRIPTION6528126Cylinder Assembly 116521685Shell216517959Rod316528119Rod Wiper416527411Head51643395O-Ring616528122Seal712708O-Ring816031018Piston Seal916528123PistonP A R T S O R D E R I N G L O GP U R C H A S E S E R I A L R E F C A S C A D E C U S T O M E R D A T EO R D E R N U M B E RP A G E N O .Q T Y P A R T N O .P A R T N O .D E S C R I P T I O N P R I C EDo you have questions you need answered right now? Call your nearest Cascade Parts Department. Visit us online at Cascade CorporationU.S. Headquarters2201 NE 201stFairview, OR 97024-9718 Tel: 800-CASCADE (227-2233) FAX: 888-329-8207Cascade Canada Inc.5570 Timberlea Blvd.Mississauga, OntarioCanada L4W-4M6Tel: 905-629-7777FAX: 905-629-7785Cascade GmbHNiederwippekühl 158579 SchalksmühleGermanyTel: 02355-50900FAX: 02355-509020Cascade FinlandA. Petreliuksenkatu 301370 VantaaFinlandTel: 09-8361925FAX: 09-8361935Cascade Italia S.R.L. European Headquarters Via Dell’Artigianato 137030 Vago di Lavagno (VR) ItalyTel: 39-045-8989111FAX: 39-045-8989160Cascade N.V.Benelux SalesDamsluisweg 56PO Box 30091300 El AlmereThe NetherlandsTel: 036-5492950FAX: 036-5492974Cascade Kenhar Ltd.3 Kelbrook RoadParkhouse Ind. EstateOpenshaw,Manchester M11 2DDEnglandTel: 0800-243015FAX: 0161-4384055Sales ScotlandMacade Systems Ltd.18 Melford RoadRighead Ind. EstateBellshill ML4 3LRScotlandTel: 01698-845777FAX: 01698-845888Cascade Scandinavia AB Hammarvägen 10PO Box 124S-56723 Vaggeryd SwedenTel: 039-336950FAX: 039-336959Cascade FranceS.A.R.L. MHP1D Rue De Charaintru BP 18,91360 Epinay-Sur-OrgeFranceTel: 01-6454-7500FAX: 01-6454-7501Cascade Hispania S.A.Calle Mogoda, 66-68 Nave 8Pol Ind Can Salvatella08210 Barberá del Vallés -Barcelona, SpainTel: +34 93719 7530Fax: +34 93719 75 31Cascade (Africa) Pty. Ltd.PO Box 625, Isando 160060A Steel RoadSparton, Kempton ParkSouth AfricaTel: 27-11-975-9240FAX: 27-11-394-1147Movimenta Lda. Parque IndustrialVale do Alecrim, Lote 108 2950-403 Palmela PortugalTel: 351-212387340 FAX: 351-212387349Sales SwitzerlandFahrzeugbedarf8810, HorgenSwitzerlandTel: 01-7279797FAX: 01-7279798Sales PolandTargowa 35/6103-728 WarszawaTel: 022-619 00 49FAX: 022-619 00 49Mobile Tel: 0501-27 29 55Sales RussiaEMCG Material HandlingEquipmentMoscowTel: 095-795-2400FAX: 095-795-2475Email:************Cascade Japan Ltd. 2-23, 2-Chome, Kukuchi Nishimachi Amagasaki, Hyogo Japan, 661-0978 Tel: 81-6-6420-9771 FAX: 81-6-6420-9777Cascade Korea121B 9L Namdong Ind.Complex, 691-8 Gojan-DongNamdong-KuInchon, 405-310 KoreaTel: 82-32-821-2051FAX: 82-32-821-2055Cascade Australia1445 Ipswich RoadRocklea, QLD 4107AustraliaTel: 1-800-227-223FAX: 617-3373-7333Cascade New Zealand15 Ra Ora DriveEast Tamaki, AucklandNew ZealandTel: 64-9-273-9136FAX: 64-9-273-9137Cascade-XiamenNo. 668 Yangguang Rd. Xinyang Industrial Zone Haicang, Xiamen City Fujian ProvinceP.R. China 361026 Tel: 86-592-651-2500 FAX: 86-592-651-2571Sunstream IndustriesPte Ltd.No. 3 Tuas Link 12263SingaporeTel: 65-6863-3488FAX: 65-6863-1368Cascade do BrasilLTDARua João Guerra, 134Macuco, Santos - SPBrasil 11015-130Tel: 55-13-2105-8800Fax: 55-13-2105-8899Cascade India MaterialHandling Private LimitedNo 9, Global Trade Centre1/1 Rambaugh ColonyLal Bahadur Shastri Road,Navi Peth, Pune 411 030(Maharashtra) IndiaPhone************/5490Fax************c。
Parts Manual cFor Technical Assistance call: 800-227-2233, Fax: 888-329-8207 To Order Parts call: 888-227-2233, Fax: 888-329-0234Push-Pull35E-PHS-121ModelSerial Number cascadeாcorporationPublicationsTO O L C A T A L O GPA R T S M A N U A LSE RVI CE M AN UA LGA0006.epsINS T AL LA T I O N I N S TR M cascade Ordering Information FAX:Mail:Phone:513-325-9270Cascade Corporation513-322-1199P .O. Box 360Springfield, Ohio 45501aster Service Manual –Part No. 673969Service Literature Index and Order Formcascade PERATOR’S GUIDEOPART NO.DESCRIPTIONParts Manual 686455Service Manual 684945Operators Guide685531Operators Pocket Guide 684944Installation Instructions680664Servicing Cascade Cylinders-VHS 679929Tool Catalog673964Literature Index Order FormDecalsPlaten Group35EREF QTY PART NO.DESCRIPTION3008460Platen Group113008498Platen – R.H.213008501Platen – Center313008495Platen – L.H.410769583Capscrew510681467Lockwasher6x3008509Shim – .030 in. (.762 mm)7x3008510Shim – .021 in. (.533 mm)823008508Hook923008504Hook10x3008505Shim – .030 in. (.762 mm)11x3008506Shim – .021 in. (.533 mm) 1213008465Hydraulic Component Group s x Quantity as required.s See Hydraulic Components page for part breakdown.35EREF QTY PART NO.DESCRIPTION3008465Hydraulic Component Group 113008466Cylinder – L.H. x213008467Cylinder – R.H. x34617917Fitting, 4-444617641Fitting, 4-4522451Fitting, 4-462222939Fitting, 4-472763024Capscrew82679828Nut923008477Hose s1013008478Hose s1113008479Hose s1226002109Hose sx See Cylinder page for parts breakdown.s Included in Hose Group 3009543.35EREF QTY PART NO.DESCRIPTION3008466Cylinder - L.H.113008471Piston Rod x223008470Retainer x313008469Tube x412712O-Ring x52615116Back-up Ring x623008474Nylon Ring x72641332Seal823008476Washer923017Snap Ring1013008475Plate xx Parts cannot be serviced.Order complete Cylinder if replacement needed.35EREF QTY PART NO.DESCRIPTION3008467Cylinder - R.H.113008471Piston Rod x223008470Retainer x313008469Tube x412712O-Ring x52615116Back-up Ring x623008474Nylon Ring x72641332Seal823008476Washer923017Snap Ring1013008475Plate xx Parts cannot be serviced.Order complete Cylinder if replacement needed.Frame Group35EREF QTY PART NO.DESCRIPTION3008459Frame Group 113008480Frame222453Fitting, 6-635EREF QTY PART NO.DESCRIPTION3008458Mounting Group 113008621Anchor Bracket22671165Upper Bearing32682814Lower Bearing413008624Sideshift Cylinder s52666984Fitting, 4-662675550Restrictor72208378Rod End Cap82208355Retainer92761170Capscrew102685906Nut112768529Capscrew122787398Washer1312680Fitting, 6-61412375Fitting, 6-61512453Fitting, 6-61622669Fitting, 6-4172617641Fitting, 4-41822451Fitting, 4-41913008659Tube2013008660Tube2113008662Tube2213008661Tubes See Sideshift Cylinder page for parts breakdown.Sideshift Cylinder35EREF QTY PART NO.DESCRIPTION3008624Sideshift Cylinder 1110042-615Piston Rod x22218324Threaded Retainer31218323Retainer x4110041-245Tube x52218326Back-up Ring x61218325Piston Seal x71218322Retainer x82562132Rod Seal92415866O-Ring102562131Wiperx Parts cannot be serviced.Order complete Cylinder if replacement needed.Bolt-On Lower Hook Group – ITA II35E/45EREF QTY PART NO.DESCRIPTION683178Lower Hook Group ITA II12679360Hook24667225Washer34779010Capscrew° ! #4°&)&(#!°5^$#°@!#%›fl ° ‡‹ 645& 987126!4%*¤^!#⁄53# ! °#! 3 5 )# ! ° fi^54*5 4 & 4⁄( PP0086.ill35E/45EREF QTY PART NO.DESCRIPTION204644Mechanism Group 11204691Arm-Inner Secondary R. H.21204692Arm-Secondary Outer R. H.34683154s Bushing4q683161Shim (.030)5q683162Shim (.060)64205070Roller7q683163Shim (.030)8q683164Shim (.060)94683155s Bushing101682821Pin11156229Washer122685661Capscrew1315682999Eye-Pin142682822Pin-Head152205065Pin166683153s Bushing17q204532Shim (.12)182204694Arm-Outer Primary 194204533Pin-Frame204204535s Bushing214204695Pin221204604Arm-Inner Primary 231204693Arm-Secondary Outer L. H. 241204690Arm-Inner Secondary L. H. 252204696Pin-Outer262682823Pin-Rod272683165Spacer2813767961Capscrewq Quantity as required.s Included in Bushing Service Kit 205075.CylinderREF QTY PART NO.DESCRIPTION582635Cylinder Assembly 11 ---Spacer 21562552Seal s 317348Snap Ring 41562334Piston 51562716Shell 61558626Rod 71559705Seal s 812785O-Ring s91615128Back-Up Ring s 101559696Retainer 111636853Wiper s 124559697Bearing 131559698Spacer 141678019Nut151671047Seal Loader Kit ss Included in Service Kit 562338.Ref: S-34242.0" D I A .%5@#2$46310!7@98PP0043.illHydraulic Group REF QTY PART NO.DESCRIPTION 685828Hydraulic Group ITA II 11685831Hose 22683173Hose312375Fitting, 6-648604511Fitting, 6-651682812s Valve62765329Capscrew, M8x1.25x20-8.872685978Hose ITA II 82684956Cable tie 94605235Fitting 5-6101200647Tube 112604510Plug, 6121200649Tube 131200648Tubes See Valve page for parts breakdown.7294089419@#9!35464PP0036.ill35E/45EValveLoad Push/Pull35E/45EREF QTY PART NO.DESCRIPTION682812Valve Assembly11677125Sequence Valve (Retract)22669597Service Kit 31682813Body 45663694Fitting, 351677124Sequence Valve (Extend)61659058Gripper Check Valve 71667516Service Kit74132562PB P R G R GB PP0041.illFaceplate Group35EREFQTYPART NO.DESCRIPTIONREF QTY PART NO.DESCRIPTION6002169Faceplate Group 40" x 40" s 6014095Gripper Jaw Assembly q 116002170Faceplate 40" x 40" s 216002134Valve31206396Gripper Jaw 426020451Sleeve516020456Gripper Cylinder, LH w 64617915Fitting, 4-4726001555Washer 816002135Gripper Bar 91672712Gripper Pad 105680253Lockwasher, M8115787375Capscrew, M8x20122605743Fitting, 6-6132686573Bearing 1426002138Hose 1526002139Hose164617918Fitting, 4-41726003718Retaining Ring 184684956Wire Tie192787373Capscrew, M8x20202768714Capscrew, M16214225346Capscrew, M162216020455Gripper Cylinder, RH w 232664762Clevis Pin 2426507Cotter Pins Width x height.q Includes items 2 through 19, 22.wSee Gripper Cylinder page for parts breakdown.REF QTY PART NO.DESCRIPTION6020456Gripper Cylinder – LH 11646540M Seal 21636850M Wiper 312718M O-Ring 412710M O-Ring51615122M Back-Up Ring 616002131Shell 716020445Rod 81685664Retainer 91685665Piston 101563462Nut 111563916Ring 1213137Ring131663728M Piston SealMIncluded in Service Kit 684827.REF QTY PART NO.DESCRIPTION6020455Gripper Cylinder – RH 11646540M Seal 21636850M Wiper 312718M O-Ring 412710M O-Ring51615122M Back-Up Ring 616014091Shell 716020445Rod 81685664Retainer 91685665Piston 101563462Nut 111563916Ring 1213137Ring131663728M Piston SealMIncluded in Service Kit 684827.For Technical Assistance call: 800-227-2233, Fax: 888-329-8207To Order Parts call: 888-227-2233, Fax: 888-329-0234cascade®▲ Included in Tube Group 6015245.Do you have questions you need answered right now? Call your nearest Cascade Parts Department. Visit us online at Cascade (UK) Ltd.15, Orgreave Crescent Dore House Industrial Estate HandsworthSheffield S13 9NQ EnglandTel: 742-697524FAX: 742-695121Cascade Scandinavia AB Box 124Hammarvägen 10567 23 Vaggeryd SwedenTel: 42-0-393-36950 FAX: 46-0-393-36959Cascade N.V. European Headquarters P.O. Box 30091300 El Almere Damsluisweg 561332 ED AlmereThe NetherlandsTel: 31-36-5492911 FAX: 31-36-5492964Cascade Norway Østerliveien 37A 1153 Oslo NorwayTel: 47-22-743160 FAX: 47-22-743157Cascade France S.A.R.L.1D Rue De CharaintruBP 18, 91360 Epinay-Sur-OrgeMorangis Cedex, FranceTel: 33-1- 64547500FAX: 33-1-64547501Cascade Hispania S.A.Carrer 5 Sector CZona Franca DuaneraPoligono de la Zon Franca08040 Barcelona, SpainOffice No. 256Tel: 93-264-07-30FAX: 93-264-07-31Cascade Canada Inc.5570 Timberlea Blvd.Mississauga, OntarioCanada L4W-4M6Tel: 905-629-7777FAX: 905-629-7785Cascade GmbHD-41199 MonchengladbachKlosterhofweg 52GermanyTel: 49-216-668230FAX: 49-216-6682323Cascade N.V.Benelux Sales and ServiceP.O. Box 30091300 El AlmereDamsluisweg 561332 ED AlmereThe NetherlandsTel: 31-36-5492950FAX: 31-36-5492974Cascade FinlandAlbert Petreliuksenkatu 301370 VantaaFinlandTel: 358-9-836-1925FAX: 358-9-836-1935Cascade Corporation2501 Sheridan AvenueSpringfield, OH 45505Tel:888-CASCADE (227-2233)FAX: 888-329-0234Cascade Japan Ltd.5-5-41,Torikai KamiSettsu, OsakaJapan, 566Tel: 81-726-53-3490FAX: 81-726-53-3497Cascade Korea108B, Namdong Ind Complex 658-3 Gojan-Dong Namdong-GuInchon, 405-310 KoreaTel: 82-32-821-2051FAX: 82-32-821-2055Cascade Australia1445 Ipswich RoadRocklea, QLD 4106AustraliaTel: 1-800227-223FAX: (07) 3373-7333Cascade New Zealand15 Ra Ora DriveEast Tamaki, AucklandNew ZealandTel: 9-273-9136FAX: 9-273-9137Cascade (Africa) Pty. Ltd.P.O. Box 625, Isando 160060A Steel RoadSparton, Kempton ParkSouth AfricaTel: 27-11-975-9240FAX: 27-11-394-1147Cascade-XiamenNo. 668 Yangguang Rd. Xinyang Industrial Zone Haicang, Xiamen City Fujian ProvinceP.R. China 361026 Tel: 86-592-651-2500 FAX: 86-592-651-2571Cascade (Singapore) Trading Co.Four Seasons Park Autumn Block - Apt. 1802 12 Cuscaden Walk SingaporeTel: 65-834-1935FAX: 65-834-1936cᮊ Cascade Corporation 20028-2002。
ModelCatalog NumberParts Manualc For Technical Assistance call: 800-227-2233, Fax: 888-329-8207To Order Parts call: 888-227-2233, Fax: 888-329-0234Carton Clamp 20D-CC-34Q (678857)cascadecorporationSafety DecalsD-Carton Clamp228156Service Manual (Current Models)670487Service Manual (Early Models, prior to 2000)210273Operator Guide670488Installation Instructions 679929Tool CatalogPublications23D-Carton ClampREF QTY PART NO.DESCRIPTION11679150No Step Decal 22665595Pinch Point Decal31679059Quick-Change Hook DecalBase Unit GroupREF QTY PART NO.DESCRIPTION 12210436Hose, 24.75 in.22210449Hose, 18.25 in.31675326Shim Kit G44665707Nut, 1/2 NC51601377Fitting, 8-86 2671222 Capscrew, 3/8 NC x .75724750Capscrew, 3/8 NC x .758 2 671570Cylinder L927861Roll Pin - Inner1027962Roll Pin - Outer 111671549Frame - Upper 128667910Washer, 1/2 ID 138667909Capscrew141672331Bumper152665707Nut, 1/2 in. IDG Includes two .015 Shims and eight .020 Shims.L See Cylinder page for parts breakdown. Reference: Base Unit: 678852, S-3197, S-4044.REF QTY PART NO.DESCRIPTION 162633523Capscrew, 1/2 NC x 2.50174208858Bearing184667663Bearing194208857Bearing20 1 678937Mounting Plate - RH21 1 678936Mounting Plate - LH221674168Frame - Lower231669957Plate241671545Lower Bumper2546205Washer, 1/2 in. ID264640013Capscrew, 1/2 NC x 1.75272602580Fitting, 828 6611288 Fitting, 6-8296230Washer20D9Cylinder Assembly20DREF QTY PART NO.DESCRIPTION671570Cylinder Assembly 126510■ Cotter Pin 22667624■ Nut Retainer 32667625■ Nut 41671572Shell 51602580Fitting 61558200Piston 712716◆ O-Ring 81662452◆ Seal 912785◆ O-Ring101615128◆ Back-Up Ring 111563906Retainer 121662448◆ Seal131638243◆ Nylon RIng 141636853◆ Wiper 151667623Nut 161671571Rod 171667626Washer 181—Spacer191671047◆ Seal Loader, Piston 201671051◆ Seal Loader, Retainer 668021Service Kit■ Included in Nut Service Kit 668926.◆ Included in Service Kit 668021.Reference: S-7605, S-7658.REF QTY PART NO.DESCRIPTION669762Check Valve – Flow Divider 11667490Special Fitting 212841O-Ring q 31667471Spool 42609453Fitting, 1052667487Spring 66604510Fitting, 671678270Check Valve – VPO 82659058Check Valve – PO 92667516Service Kit q101679846Low Flow Spool Kitq Included in Service Kit 667513.s For eliminating regeneration circuit only. See Tech. Bulletin 121.Reference: SK-5302.Check ValveREF QTY PART NO.DESCRIPTION112667494Fitting 1222840O-Ring q 132673098Spring 142667492Poppet151673089Spool Assembly 162667491Sleeve 171669763Valve Body 181661347Service Kit q191676343Regeneration Elimination Plug s 667513Service KitContact Pad and Arm GroupREF QTY PART NO.DESCRIPTION 12671590Arm22661212Spring3■675620Washer48200590Bushing54677205Pin61675626Bushing Driver Tool74602580Plug81676331Stabilizer - RH91676329Stabilizer - LH 1014550218Nut■Quantity as required for proper adjustment. Reference: Basic Group 678852, S-3197, S-2909,S-3058, S-3059, S-3091.REF QTY PART NO.DESCRIPTION 1184674Capscrew, 1/2 x 1.75 122676871Contact Pad, 46" x 48" 131675621Tip - LH141675624Tip - RH1564672Capscrew, 1/2 x 1.25 164675614Stabilizer Wear Tile 171678665Tip Wear Tile - LH 181678666Tip Wear Tile - RH19●676841Contact Pad Repair Kit 204677094Shim●Repairs one hole.20DQuick-Change Mounting GroupClass IIREF QTY PART NO.DESCRIPTION678833Lower Hook Group12675514Hook24678942Capscrew, 5/8 NC x 1.2532675515Guide42678832PinReference: S-3197.Backrest GroupREF QTY PART NO.DESCRIPTION669766Backrest Group11669897Backrest28677828Capscrew, 1/2 NC x 1.25 38667910Washer, 1/2 in. ID4v674356Tube Endv As required.P A R T S O R D E R I N G L O GP U R C H A S E S E R I A L R E F C A S C A D E C U S T O M E R D A T EO R D E R N U M B E RP A G E N O .Q T Y P A R T N O .P A R T N O .D E S C R I P T I O N P R I C EDo you have questions you need answered right now? Call your nearest Cascade Parts Department.Visit us online at AMERICASCascade CorporationParts Sales2501 Sheridan Ave. Springfield, OH 45505Tel: 888-CASCADE (227-2233) Fax: 888-329-0234Cascade Canada Inc.5570 Timberlea Blvd.Mississauga, OntarioCanada L4W-4M6Tel: 905-629-7777Fax: 905-629-7785Cascade do BrasilPraça Salvador Rosa,131/141-Jordanópolis,São Bernardo do Campo - SPCEP 09891-430Tel: 55-13-2105-8800Fax: 55-13-2105-8899EUROPE-AFRICACascade Italia S.R.L. European Headquarters Via Dell’Artigianato 1 37030 Vago di Lavagno (VR) ItalyTel: 39-045-8989111Fax: 39-045-8989160Cascade (Africa) Pty. Ltd. PO Box 625, Isando 1600 60A Steel Road Sparton, Kempton Park South AfricaTel: 27-11-975-9240 Fax: 27-11-394-1147ASIA-PACIFICCascade Japan Ltd. 2-23, 2-Chome, Kukuchi Nishimachi Amagasaki, Hyogo Japan, 661-0978 Tel: 81-6-6420-9771 Fax: 81-6-6420-9777Cascade Korea121B 9L Namdong Ind.Complex, 691-8 Gojan-DongNamdong-KuInchon, KoreaTel: +82-32-821-2051Fax: +82-32-821-2055Cascade-XiamenNo. 668 Yangguang Rd.Xinyang Industrial ZoneHaicang, Xiamen CityFujian ProvinceP.R. China 361026Tel: 86-592-651-2500Fax: 86-592-651-2571Cascade India MaterialHandling P LtdSy no 271/8, Ingawale PatilEstate,Godown No.9,10 & 11, Bhugaon,Off Paud Road, Tal Mulshi, DistPune 411 042Cascade Australia Pty. Ltd.36 Kiln StreetDarra QLD 4076 AustraliaTel: 1-800-227-223Fax: +61 7 3373-7333Cascade New Zealand15 Ra Ora DriveEast Tamaki, AucklandNew ZealandTel: +64-9-273-9136Fax: +64-9-273-9137Sunstream IndustriesPte. Ltd.18 Tuas South Street 5Singapore 637796Tel: +65-6795-7555Fax: +65-6863-1368c。
Data ExchangeExtended Data Exchange (XDE)User’s GuideVersion 6.3 / September 2008Copyright © 2008, by Open CASCADE S.A.S.PROPRIETARY RIGHTS NOTICE: All rights reserved. No part of this material may be reproduced or transmitted in any form or by any means, electronic, mechanical, or otherwise, including photocopying and recording or in connection with any information storage or retrieval system, without the permission in writing from Open CASCADE S.A.S.The information in this document is subject to change without notice and should not be construed as a commitment by Open CASCADE S.A.S. Open CASCADE S.A.S. assures no responsibility for any errors that may appear in this document.The software described in this document is furnished under a license and may be used or copied only in accordance with the terms of such a license.CAS.CADE and Open CASCADE are registered trademarks of Open CASCADE S.A.S. Other brand or product names are trademarks or registered trademarks of their respective holders.NOTICE FOR USERS:This User Guide is a general instruction for Open CASCADE study. It may be incomplete and even contain occasional mistakes, particularly in examples, samples, etc. Open CASCADE S.A.S. bears no responsibility for such mistakes. If you find any mistakes or imperfections in this document, or if you have suggestions for improving this document, please, contact us and contribute your share to the development of Open CASCADE Technology: bugmaster@Tour Opus 1277, Esplanade du Général de Gaulle92914 PARIS LA DEFENSEFRANCEContents1.INTRODUCTION (1)1.1.O VERVIEW OF THE E XTENDED D ATA E XCHANGE (XDE) (1)1.1.1.Prerequisite (1)1.1.2.Environment variables (1)1.1.3.Basic terms (1)1.1.4.XDE Data Types (1)1.1.5.XDE Organization (2)1.1.6.Assemblies (2)1.1.7.Validation Properties (3)s (4)1.1.9.Colors and Layers (4)2.BASIC CONCEPTS (6)2.1.O VERVIEW (6)2.1.1.General Check (6)2.1.2.Getting an Application or an Initialized Document (6)2.2.S HAPES AND A SSEMBLIES (6)2.2.1.Initializing an XDE Document (Shapes) (6)2.2.2.Getting a Node considered as an Assembly (7)2.2.3.Updating the Assembly after Filling or Editing (7)2.2.4.Adding or Setting Top Level Shapes (7)2.2.5.Setting a given Shape at a given Label (8)2.2.6.Getting a Shape from a Label (8)2.2.7.Getting a Label from a Shape (8)2.2.8.Other Queries on a Label (9)2.2.9.Instances and References for Components (10)2.3.E DITING S HAPES (11)2.4.M ANAGEMENT OF S UB-S HAPES (11)2.5.P ROPERTIES (12) (12)2.5.2.Centroid (13)2.5.3.Area (14)2.5.4.Volume (14)2.6.C OLORS (14)2.6.1.Initialization (15)2.6.2.Adding a Color (15)2.6.3.Queries on Colors (16)2.6.4.Editing Colors (17)2.7.L AYERS (17)2.7.1.Reading and Writing STEP or IGES (17)2.7.2.Reading a STEP file (18)2.7.3.Writing a STEP file (18)2.7.4.Reading an IGES File (19)2.7.5.Writing an IGES File (19)2.8.U SING AN XDE D OCUMENT (19)2.8.1.XDE Data inside an Application Document (19)3.PACKAGE XCAFDOC (21)3.1.G ENERAL DESCRIPTION (21)3.2.E NUMERATION XCAFD OC_C OLOR T YPE (21)3.3.C LASS XCAFD OC_D OCUMENT T OOL (21)3.3.1.General description (21)3.3.2.Methods (22)3.4.C LASS XCAFD OC_L OCATION (23)3.4.1.General description (23)3.4.2.Methods (23)3.5.C LASS XCAFD OC_C OLOR (23)3.5.1.General description (23)3.5.2.Methods (23)3.6.C LASS XCAFD OC_V OLUME (24)3.6.1.General description (24)3.6.2.Methods (25)3.7.C LASS XCAFD OC_A REA (25)3.7.1.General description (25)3.7.2.Methods (25)3.8.C LASS XCAFD OC_C ENTROID (26)3.8.1.General description (26)3.8.2.Methods (26)3.9.C LASS XCAFD OC_S HAPE T OOL (26)3.9.1.General description (26)3.9.2.Methods (27)3.10.C LASS XCAFD OC_C OLOR T OOL (31)3.10.1.General description (31)3.10.2.Methods (32)3.11.C LASS XCAFD OC_L AYER T OOL; (34)3.11.1.General description (34)3.11.2.Methods (35)3.12.C LASS XCAFD OC_G RAPH N ODE; (38)3.12.1.General description (38)3.12.2.Methods (38)3.13.P ACKAGE METHODS (40)1. Introduction1.1. Overview of the Extended Data Exchange (XDE)This manual explains how to use the Extended Data Exchange (XDE). It provides basicdocumentation on setting up and using XDE. For advanced information on XDE and itsapplications, see our offerings on our web site at/support/training.htmlBased on document architecture, XDE allows processing of various types of data to andfrom external files.XDE is available for users of Open CASCADE on all supported platforms (Linux, SunSolaris, Windows NT).1.1.1. PrerequisiteThe Extended Data Exchange (XDE) component requires Advanced Shape Healing foroperation.1.1.2. Environment variablesTo use XDE you have to set the environment variables properly. Make sure that twoimportant environment variables are set as follows:•CSF_PluginDefaults points to sources of %CASROOT%/src/XCAFResources ($CASROOT/src/XCAFResources).•CSF_XCAFDefaults points to sources of %CASROOT%/src/XCAFResources ($CASROOT/src/XCAFResources).1.1.3. Basic termsFor better understanding of XDE, certain key terms are defined:•Shape A (simple) shape is a standalone shape, which does not belong to the assembly structure.•Instance An instance (of a shape) is a replication of another shape with a location that can be the same location or a different one.Assembly An assembly defines a construction that is either a root or a sub-assembly.1.1.4. XDE Data TypesThe following types of data are currently supported:• assemblies• validation properties• names• colors• layersIt is also possible to add new types of data by using tools as prototypes. This makes XDEa basically extensible framework.In addition, XDE provides reading and writing tools to read and write the data supported by STEP and IGES files.1.1.5. XDE OrganizationThe basis of XDE, called XCAF, is a framework based on OCAF (Open CASCADE Application Framework) and is intended to be used with assemblies and with various kinds of attached data (attributes). Attributes can be Individual attributes for a shape, specifying some characteristics of a shape, or they can be Grouping attributes, specifying that a shape belongs to a given group whose definition is specified apart from the shapes.XDE works in an OCAF document with a specific organization defined in a dedicated XCAF module. This organization is used by various functions of XDE to exchange standardized data other than shapes and geometry.The Assembly Structure and attributes assigned to shapes are stored in the OCAF tree. It is possible to obtain TopoDS representation for each level of the assembly in the form of TopoDS_Compound or TopoDS_Shape using the API.Basic elements used by XDE are introduced in the XCAF sub-module by the package XCAFDoc. These elements consist in descriptions of commonly used data structures (apart from the shapes themselves) in normalized data exchanges. They are not attached to specific applications and do not bring specific semantics, but are structured according to the use and needs of data exchanges.The Document used by XDE usually starts as a TDocStd_Document.1.1.6. AssembliesXDE supports assemblies by separating shape definitions and their locations. Shapes are simple OCAF objects without a location definition. An assembly consists of several components. Each of these components references one and the same specified shape with different locations. All this provides an increased flexibility in working on multi-level assemblies.For example, a mechanical assembly can be defined as follows:Figure 1. Assembly Description and ViewXDE defines the specific organization of the assembly content. Shapes are stored on sub-labels of label 0:1:1. There can be one or more roots (called free shapes) whether they are true trees or simple shapes. A shape can be considered to be an Assembly (such as AS1 under 0:1:1:1 in Figure1) if it is defined with Components (sub-shapes, located or not).XCAFDoc_ShapeTool is a tool that allows you to manage the Shape section of the XCAF document. This tool is implemented as an attribute and located at the root label of the shape section.1.1.7. Validation PropertiesValidation properties are geometric characteristics of Shapes (volume, centroid, surface area) written to STEP files by the sending system. These characteristics are read by the receiving system to validate the quality of the translation. This is done by comparing the values computed by the original system with the same values computed by the receiving system on the resulting model.Advanced Data Exchange supports both reading and writing of validation properties, and provides a tool to check them.Figure 2. Validation Property DescriptionsCheck logs contain deviations of computed values from the values stored in a STEP file. Atypical example appears as follows:Label Area defect Volume defect dX dY DZ Name(0%) 0.00 0.00 0.00 "S1"(0%) -181.70:1:1:1 312.6(0%) -191.2(0%) -0.00 0.00 -0.00 "MAINBODY"0:1:1:2 -4.60:1:1:3 -2.3 (0%) -52.5 (0%) -0.00 0.00 0.00 "MAIN_BODY_BACK" 0:1:1:4 -2.3 (0%) -51.6 (0%) 0.00 0.00 -0.00 "MAIN_BODY_FRONT" 0:1:1:5 2.0 (0%) 10.0 (0%) -0.00 0.00 -0.00 "HEAD"0:1:1:6 0.4 (0%) 0.0 (0%) 0.00 -0.00 -0.00 "HEAD_FRONT"0:1:1:7 0.4 (0%) 0.0 (0%) 0.00 -0.00 -0.00 "HEAD_BACK"0.00 0.00 "TAIL"(0%) -0.00(0%) 10.90:1:1:8 -320.60:1:1:9 0.0 (0%) 0.0 (0%) -0.00 -0.00 0.00 "TAIL_MIDDLE"(0%) -0.00 0.00 -0.00 "TAIL_TURBINE"(0%) 4.80:1:1:10 -186.20:1:1:11 0.3 (0%) -0.0 (0%) -0.00 -0.00 0.00 "FOOT"0:1:1:12 0.0 (0%) -0.0 (0%) 0.00 -0.00 -0.00 "FOOT_FRONT"0:1:1:13 0.0 (0%) 0.0 (0%) -0.00 0.00 0.00 "FOOT_BACK"In our example, it can be seen that no errors were detected for either area, volume orpositioning data.1.1.8. NamesXDE supports reading and writing the names of shapes to and from IGES and STEP fileformats. This functionality can be switched off if you do not need this type of data, therebyreducing the size of the document.1.1.9. Colors and LayersXDE can read and write colors and layers assigned to shapes or their subparts (down tothe level of faces and edges) to and from both IGES and STEP formats. Three types ofcolors are defined in the enumeration XCAFDoc_ColorType:•generic color (XCAFDoc_ColorGen)•surface color (XCAFDoc_ColorSurf)• curve color (XCAFDoc_ColorCurv)Figure 3. Colors and LayersBasic Concepts2. Basic Concepts2.1. OverviewAs explained in the last chapter, XDE uses TDocStd_Documents as a starting point. Thegeneral purpose of XDE is:•Checking if an existing document is fit for XDE•Getting an application and initialized document•Initializing a document to fit it for XDE•Adding, setting and finding data•Querying and managing shapes•Attaching properties to shapesThe Document used by XDE usually starts as a TDocStd_Document.2.1.1. General CheckBefore working with shapes, properties, and other types of information, the globalorganization of an XDE Document can be queried or completed to determine if an existingDocument is actually structured for use with XDE.To find out if an existing TDocStd_Document is suitable for XDE, use:Handle(TDocStd_Document) doc...if ( XCAFDoc_DocumentTool::IsXCAFDocument (doc) ) { .. yes .. }If the Document is suitable for XDE, you can perform operations and queries explained inthis guide. However, if a Document is not fully structured for XDE, it must be initialized.See 2.2.1 Initializing an XDE Document (Shapes).2.1.2. Getting an Application or an Initialized DocumentIf you want to retrieve an existing application or an existing document (known to becorrectly structured for XDE), use:Handle(TDocStd_Document) aDoc;Handle(XCAFApp_Application) anApp =XCAFApp_Application::GetApplication();anApp->NewDocument("MDTV-XCAF",aDoc);2.2. Shapes and Assemblies2.2.1. Initializing an XDE Document (Shapes)An XDE Document begins with a TDocStd_Document. Assuming you have aTDocStd_Document already created, you can ensure that it is correctly structured for XDEby initializing the XDE structure as follows:Handle(TDocStd_Document) doc...Handle (XCAFDoc_ShapeTool) myAssembly =XCAFDoc_DocumentTool::ShapeTool (Doc->Main());TDF_Label aLabel = myAssembly->NewShape()NOTE The method XCAFDoc_DocumentTool::ShapeTool returns the XCAFDoc_ShapeTool. The first time this method is used, it creates the XCAFDoc_ShapeTool. In our example, a handle is used for the TDocStd_Document.2.2.2. Getting a Node considered as an AssemblyTo get a node considered as an Assembly from an XDE structure, you can use the Labelof the node. Assuming that you have a properly initialized TDocStd_Document, use:Handle(TDocStd_Document) doc...Handle(XCAFDoc_ShapeTool) myAssembly =XCAFDoc_DocumentTool::ShapeTool (aLabel);In the previous example, you can also get the Main Item of an XDE document, whichrecords the root shape representation (as a Compound if it is an Assembly) by usingShapeTool(Doc->Main()) instead of ShapeTool(aLabel).You can then query or edit this Assembly node, the Main Item or another one (<myAssembly> in our examples).NOTE For the examples in the rest of this guide, <myAssembly>is always presumed tobe accessed this way, so this information will not be repeated.2.2.3. Updating the Assembly after Filling or EditingSome actions in this chapter affect the content of the document, considered as an Assembly. As a result, you will sometimes need to update various representations (including the compounds).To update the representations, use:myAssembly->UpdateAssembly(aLabel);Since this call is always used by the editing functions, you need not apply it for suchfunctions. However, you will need this call if special edits, not using XCAF functions, areused on the document.2.2.4. Adding or Setting Top Level ShapesShapes can be added as top-level shapes. Top level means that they can be added to anupper level assembly or added on their own at the highest level as a component or referred by a located instance. Therefore two types of top-level shapes can be added: •shapes with upper level references•free shapes (that correspond to roots) without any upper referenceNOTE Several top-level shapes can be added to the same component.A shape to be added can be defined as a compound (if required), with the followinginterpretations:•The Shape is a compoundAccording to the user choice, it may or may not be interpreted as representing an Assembly. If it is an Assembly, each of its subshapes defines a sub-label.•The Shape is not a compoundThe Shape is taken as a whole, without breaking it down.To break down a Compound in the assembly structure, use:Standard_Boolean makeAssembly;// True to interpret a Compound as an Assembly,// False to take it as a wholeaLabel = myAssembly->AddShape(aShape, makeAssembly);Each node of the assembly therefore refers to its sub-shapes.Concerning located instances of sub-shapes, the corresponding shapes, (without location) appear at distinct sub-labels. They are referred to by a shape instance, which associatesa location.2.2.5. Setting a given Shape at a given LabelA top-level shape can be changed. In this example, no interpretation of compound isperformed:Standard_CString LabelString ...;// identifies the Label (form "0:i:j...")TDF_Label aLabel...;// A label must be presentmyAssembly->SetShape(aLabel, aShape);2.2.6. Getting a Shape from a LabelTo get a shape from its Label from the top-level, use:TDF_Label aLabel...// A label must be presentif (aLabel.IsNull()) {// no such label : abandon}TopoDS_Shape aShape;aShape = myAssembly->GetShape(aLabel);if (aShape.IsNull()) {// this label is not for a Shape}NOTE: If the label corresponds to an assembly, then the result is a compound.2.2.7. Getting a Label from a ShapeTo get a Label which is attached to a Shape from the top-level, use:Standard_Boolean findInstance = Standard_False;// (this is default value)aLabel = myAssembly->FindShape(aShape [,findInstance]);if (aLabel.IsNull()) {// no label found for this shapeIf <findInstance> is True, a search is made for the shape with the same location. If False (default value), a search is made among original, non-located shapes.2.2.8. Other Queries on a LabelVarious other queries can be made from a Label within the Main Item of XDE:Main ShapesTo determine if a Shape is recorded (or not), use:if ( myAssembly->IsShape(aLabel) ) { .. yes .. }To determine if the shape is "top-level" (was added by the AddShape method), use:if ( myAssembly->IsTopLevel(aLabel) ) { .. yes .. }To get a list of top-level shapes (added by the AddShape method), use:TDF_LabelSequence frshapes;myAssembly->GetShapes(frshapes);To get all free shapes at once if the list above has only one item, use:TopoDS_Shape result = myAssembly->GetShape(frshapes.Value(1));If there is more than one item, you must create and fill a compound, use:TopoDS_Compound C;BRep_Builder B;B.MakeCompound(C);for(Standard_Integer i=1; i<=frshapes.Length(); i++) {TopoDS_Shape S = myAssembly->GetShape(frshapes.Value(i));B.Add(C,S);}In our example, the result is the compound C.To determine if a shape is a free shape (no reference or super-assembly), use:if ( myAssembly->IsFree(aLabel) ) { .. yes .. }To get a list of Free Shapes (roots), use:TDF_LabelSequence frshapes;myAssembly->GetFreeShapes(frshapes);To get the shapes, which use a given shape as a component, use:Standard_Integer nbusers = myAssembly->GetUsers(aLabel,users);The count of users is contained with nbusers. It contains 0 if there are no users.Assembly and ComponentsTo determine if a label is attached to the main part or to a sub-part (component), use:if (myAssembly->IsComponent(aLabel)) { .. yes .. }To determine whether a label is a node of a (sub-) assembly or a simple shape, use:if ( myAssembly->IsAssembly(aLabel) ) { .. yes .. }If the label is a node of a (sub-) assembly, you can get the count of components, use:Standard_Boolean subchilds = Standard_False; //defaultStandard_Integer nbc = myAssembly->NbComponents (aLabel[,subchilds]);If <subchilds> is True, commands also consider sub-levels. By default, only level one is checked.To get component Labels themselves, use:Standard_Boolean subchilds = Standard_False; //defaultTDF_LabelSequence comps;Standard_Boolean isassembly = myAssembly->GetComponents(aLabel,comps[,subchilds]);2.2.9. Instances and References for ComponentsTo determine if a label is a simple shape, use:if ( myAssembly->IsSimpleShape(aLabel) ) { .. yes .. }To determine if a label is a located reference to another one, use:if ( myAssembly->IsReference(aLabel) ) { .. yes .. }If the label is a located reference, you can get the location, use:TopLoc_Location loc = myAssembly->GetLocation (aLabel);To get the label of a referenced original shape (also tests if it is a reference), use:Standard_Boolean isref = myAssembly->GetReferredShape(aLabel, refLabel);NOTE <isref>returns False if <aLabel>is not for a reference.2.3. Editing ShapesIn addition to the previously described AddShape and SetShape, several shape edits arepossible.To remove a Shape, and all its sub-labels, use:Standard_Boolean remsh = myAssembly->RemoveShape(aLabel);// remsh is returned True if doneNOTE: This operation will fail if the shape is neither free nor top level.To add a Component to the Assembly, from a new shape, use:Standard_Boolean expand = Standard_False; //defaultTDF_Label aLabel = myAssembly->AddComponent (aShape[,expand]);If <expand> is True and if <aShape> is a Compound, it is broken down to produce sub-components, one for each of its sub-shapes.To add a component to the assembly, from a previously recorded shape (the newcomponent is defined by the label of the reference shape, and its location), use:TDF_Label refLabel ...; // the label of reference shapeTopLoc_Location loc ...; // the desired locationTDF_Label aLabel = myAssembly->AddComponent (refLabel, loc);To remove a component from the assembly, use:myAssembly->RemoveComponent (aLabel);2.4. Management of Sub-ShapesIn addition to components of a (sub-)assembly, it is possible to have individualidentification of some sub-shapes inside any shape. Therefore, you can attach specificattributes such as Colors. Some additional actions can be performed on sub-shapes thatare neither top-level, nor components:To add a sub-shape to a given Label, use:TDF_Label subLabel = myAssembly->AddSubShape (aLabel,subShape);To find the Label attached to a given sub-shape, use:TDF_Label subLabel; // new label to be computedif ( myAssembly-> FindSubShape (aLabel, subShape,subLabel)) { .. yes .. }If the sub-shape is found (yes), <subLabel> is filled by the correct value.To find the top-level simple shape (not a compound whether free or not), which contains agiven sub-shape, use:TDF_Label mainLabel = myAssembly->FindMainShape(subShape);NOTE: There should be only one shape for a valid model. In any case, the search stopson the first one found.To get the sub-shapes of a shape, which are recorded under a label, use:TDF_LabelSequence subs;Standard_Boolean hassubs = myAssembly->GetSubShapes(aLabel,subs);2.5. PropertiesSome properties can be attached directly to shapes. These properties are:•Name (standard definition from OCAF)•Centroid (for validation of transfer)•Volume (for validation of transfer)•Area (for validation of transfer)Some other properties can also be attached, and are also managed by distinct tools forColors and Layers. Colors and Layers are managed as an alternative way of organizingdata (by providing a way of identifying groups of shapes).Colors are put into a table of colors while shapes refer to this table. There are two ways ofattaching a color to a shape:•By attaching an item from the table.•Adding the color directly.When the color is added directly, a search is performed in the table of contents todetermine if it contains the requested color. Once this search and initialize operation isdone, the first way of attaching a color to a shape is used.2.5.1. NameName is implemented and used as a TDataStd_Name, which can be attached to anylabel. Before proceeding, consider that:•In IGES, every entity can have a name with an optional numeric part called a Subscript Label. For example, "MYCURVE" is a name, and "MYCURVE(60)" is aname with a Subscript Label.•In STEP, there are two levels: Part Names and Entity Names:Part Names are attached to "main shapes" such as parts and assemblies. These PartNames are specifically supported by XDE.Entity Names can be attached to every Geometric Entity. This option is rarely used, as ittends to overload the exploitation of the data structure. Only some specific cases justifyusing this option: for example, when the sending system can really ensure the stability ofan entity name after each STEP writing. If such stability is ensured, you can use this option to send an Identifier for external applications using a database.NOTE: Both IGES or STEP files handle names as pure ASCII strings.These considerations are not specific to XDE. What is specific to data exchange is the way names are attached to entities.To get the name attached to a label (as a reminder using OCAF), use:Handle(TDataStd_Name) N;if ( !aLabel.FindAttribute(TDataStd_Name::GetID(),N)) {// no name is attached}TCollection_ExtendedString name = N->Get();Don't forget to consider Extended String as ASCII, for the exchange file.To set a name to a label (as a reminder using OCAF), use:TCollection_ExtendedString aName ...;// contains the desired name for this Label (ASCII)TDataStd_Name::Set (aLabel, aName);2.5.2. CentroidA Centroid is defined by a Point to fix its position. It is handled as a property, item of theclass XCAFDoc_Centroid, sub-class of TDF_Attribute. However, global methods give access to the position itself.This notion has been introduced in STEP, together with that of Volume, and Area, as defining the "Validation Properties": this feature allows exchanging the geometries and some basic attached values, in order to perform a synthetic checking on how they are maintained after reading and converting the exchange file. This exchange depends on reliable exchanges of Geometry and Topology. Otherwise, these values can be considered irrelevant.Along with Volume (see 2.5.4), it can be determined at any level of an assembly, thereby allowing a check of both individual simple shapes and their combinations including locations.To get a Centroid attached to a Shape, use:gp_Pnt pos;Handle(XCAFDoc_Centroid) C;aLabel.FindAttribute ( XCAFDoc_Centroid::GetID(), C );if ( !C.IsNull() ) pos = C->Get();To set a Centroid to a Shape, use:gp_Pnt pos (X,Y,Z);// the position previously computed for the centroidXCAFDoc_Centroid::Set ( aLabel, pos );2.5.3. AreaAn Area is defined by a Real, it corresponds to the computed Area of a Shape, providedthat it contains surfaces. It is handled as a property, item of the class XCAFDoc_Area,sub-class of TDF_Attribute.This notion has been introduced in STEP but it is usually disregarded for a Solid, asVolume is used instead. In addition, it is attached to simple shapes, not to assemblies.To get an area attached to a Shape, use:Standard_Real area;Handle(XCAFDoc_Area) A;L.FindAttribute ( XCAFDoc_Area::GetID(), A );if ( !A.IsNull() ) area = A->Get();To set an area value to a Shape, use:Standard_Real area ...;// value previously computed for the areaXCAFDoc_Area::Set ( aLabel, area );2.5.4. VolumeA Volume is defined by a Real and corresponds to the computed volume of a Shape,provided that it contains solids. It is handled as a property, an item of the classXCAFDoc_Volume, sub-class of TDF_Attribute.This notion has been introduced in STEP. It may be attached to simple shapes or theirassemblies for computing cumulated volumes and centers of gravity (see also 2.5.2Centroid).To get a Volume attached to a Shape, use:Standard_Real volume;Handle(XCAFDoc_Volume) V;L.FindAttribute ( XCAFDoc_Volume::GetID(), V );if ( !V.IsNull() ) volume = V->Get();To set a volume value to a Shape, use:Standard_Real volume ...;// value previously computed for the volumeXCAFDoc_Volume::Set ( aLabel, volume );2.6. ColorsIn an XDE document, colors are managed by the class XCAFDoc_ColorTool. This is donewith the same principles as for ShapeTool with Shapes, and with the same capability ofhaving a tool on the Main Label, or on any sub-label. The Property itself is defined as anXCAFDoc_Color, sub-class of TDF_Attribute.。
OpenCascade入门教程TutorialMy First ApplicationVersion 6.3 / September 2008Table of Contents1.PROJECT OVERVIEW (4)1.1.P REREQUISITES (4)1.2.T HE PROJECT (4)1.3.P ROJECT S PECIFICATIONS (4)2.BUILDING THE PROFILE (6)2.1.D EFINING S UPPORT P OINTS (6)2.2.P ROFILE:D EFINING THE G EOMETRY (7) 2.3.P ROFILE:D EFINING THE T OPOLOGY (8)2.4.P ROFILE:C OMPLETING THE P ROFILE (10)3.BUILDING THE BODY (12)3.1.P RISM THE P ROFILE (12)3.2.A PPLYING F ILLETS (13)3.3.A DDING THE N ECK (15)3.4.C REATING A H OLLOWED S OLID (16)4.BUILDING THE THREADING (19)4.1.C REATING S URFACES (19)4.2.D EFINING 2D C URVES (19)4.3.B UILDING E DGES AND W IRES (23)4.4.C REATING T HREADING (24)5.BUILDING THE RESULTING COMPOUND (26)6.APPENDIX (27)4 Project Overview1. Project OverviewThis tutorial will teach you how to use Open CASCADE services to model a 3D object. The purpose ofthis tutorial is not to describe all Open CASCADE classes but to help you to start thinking in terms of the Open CASCADE tool.1.1. PrerequisitesThis tutorial assumes that you have experience in using and setting up C++.From a programming standpoint, Open CASCADE is designed to enhance your C++ tools with high performance modeling classes, methods and functions. The combination of all these resources will allow you to create substantial applications.1.2. The projectTo illustrate the use of classes provided in the 3D geometric modeling toolkits, you will create a bottle as shown:In the tutorial we will create, step-by-step, a function that will model a bottle as shown above. You will find the complete source code of this tutorial, including the very function MakeBottle in the distribution of Open CASCADE. The function body is provided in the file Tutorial/src/MakeBottle.cxx.1.3. Project SpecificationsWe first define the bottle specifications as follows:Object Parameter ParameterName Parameter Value Bottle height MyHeight 70mmBottle width MyWidth 50mm Bottle thickness MyThickness30mm为了演示3D 几何模型工具箱中类的使用丆你可以创建一个如下的瓶子。
$SSOLFDWLRQ)UDPHZRUNWhat is OCAF ?Purpose of OCAF (1)Overview of the Architecture (2)Getting Started (3)Benefits of OCAF (4)A Look Inside OCAFThe Design of OCAF (5)The Data Framework (8)Persistent Data Storage (11)Version 6.3 / September 2008Tour Opus 1277, Esplanade du Général de Gaulle92914 PARIS LA DEFENSEFRANCECopyright © 2008, by Open CASCADE S.A.S. PROPRIETARY RIGHTS NOTICE: All rights reserved. No part of this material may be reproduced or transmitted in any form or by any means, electronic, mechanical, or otherwise, including photocopying and recording or in connection with any information storage or retrieval system, without the permission in writing from Open CASCADE S.A.S. The information in this document is subject to change without notice and should not be construed as a commitment by Open CASCADE S.A.S. Open CASCADE S.A.S. assures no responsibility for any errors that may appear in this document. The software described in this document is furnished under a license and may be used or copied only in accordance with the terms of such a license. CAS.CADE and Open CASCADE are registered trademarks of Open CASCADE S.A.S. Other brand or product names are trademarks or registered trademarks of their respective holders.NOTICE FOR USERS:This User Guide is a general instruction for Open CASCADE study. It may be incomplete and even contain occasional mistakes, particularly in examples, samples, etc. Open CASCADE S.A.S. bears no responsibility for such mistakes. If you find any mistakes or imperfections in this document, or if you have suggestions for improving this document, please, contact us and contribute your share to the development of Open CASCADE Technology: bugmaster@What is OCAF ? Purpose of OCAFThe Open CASCADE Application Framework (OCAF) is an easy-to-use platformfor rapid ly develop ing sophisticated domain-specific design applications. A typicalapplication developed using OCAF deals with two or three-dimensional (2D or 3D)geometric modeling in trade-specific Computer Aided Design (CAD) systems,manufacturing or analysis applications, simulation applications or illustration tools.Developing a design application requires addressing many technical aspects. Inparticular, given the functional specification of your application, you must at least:n Design the architecture of the application — definition of the software components and the way they cooperaten Define the data model able to support the functionality required — a design application operates on data maintained during the whole end-user workingsessionn Structure the software in order toµsynchronize the display with the data — commands modifying objects must update the viewsµsupport generalized undo-redo commands — this feature has to be taken into account very early in the design processn Implement the function for saving the data — if the application has a long life cycle, the compatibility of data between versions of the application has to beaddressedn Build the application user interfaceBy providing architectural guidance and ready-to-use solutions to these issues,OCAF helps you to develop your application significantly faster: you concentrateon the application’s functionality.© Open CASCADE S.A. 1What is OCAF ?© Open CASCADE S.A. 2Overview of the ArchitectureOCAF provides you with an object-oriented Application-Document-Attributemodel. This consists of C++ class libraries. The main class, Application , is anabstract class in charge of handling documents during the working session.Services provided by this class include:nCreating new documents nSaving documents and opening them n Initializing document viewsThe document, implemented by the concrete class Document , is the container forthe application data. Its main purpose is to centralize notifications of data editingin order to provide Undo-Redo. Each document is saved in a single flat ASCII filedefined by its format and extension (a ready-to-use format is provided withOCAF).Application data are attributes, that is, instances of classes derived from theAttribute abstract class, organized according to the OCAF Data Framework.The OCAF Data Framework references aggregations of attributes usingpersistent identifiers in a single hierarchy (the Data Framework is described in thenext chapter, A Look Inside OCAF ). A wide range of attributes come with OCAF,including:nPrimitive attributes such as Integer, Real, Name and Comment nShape attribute containing the geometry of the whole model or elements of it n Other geometric attributes such as Datums (points, axis and plane) and Constraints such as tangent-to, at-a-given-distance, from-a-given-angle,concentric, etc.n Modeling step and Function attributes — the purpose of these attributes is to rebuild objects after they have been modified (parameterization of models)n Visualization attributes — these attributes allow data to be visualized in a 2D or 3D viewernUser attributes, that is, attributes typed by the application In addition, application-specific data can be added by defining new attributeclasses; naturally, this changes the standard file format. The only functions thathave to be implemented are:nCopying the attribute n Converting it from and to its persistent homolog (persistence is briefly presented in the paragraph Persistent Data Storage in the next chapter)Figure 1 below illustrates this architecture.What is OCAF ? Figure 1The Application-Document-Attribute modelNote As OCAF uses other modules of Open CASCADE — see the technical overview of Open CASCADE in the appendix — the Shape attribute is implemented withthe geometry supported by the Modeling Data module and the viewer is the oneprovided with the Visualization module. Modeling functions can be implementedusing the Modeling Algorithms module.Getting StartedAt the beginning of your development, you first define an application class byinheriting from the Application abstract class. You only have to create anddetermine the resources of the application for specifying the format of yourdocuments (you generally use the standard one) and their file extension.Then, you design the application data model by organizing attributes you chooseamong those provided with OCAF. You can specialize these attributes using theUser attribute. For example, if you need a reflection coefficient, you aggregate aUser attribute identified as a reflection coefficient with a Real attribute containingthe value of the coefficient (as such, you don’t define a new class).If you need application specific data not provided with OCAF, for example, toincorporate a finite element model in the data structure, you define a new attributeclass containing the mesh, and you include its persistent homolog in a new fileformat.© Open CASCADE S.A.3What is OCAF ?© Open CASCADE S.A. 4Once you have implemented the commands which create and modify the datastructure according to your specification, OCAF provides you, without anyadditional programming:nPersistent reference to any data, including geometric elements — several documents can be linked with such reference nDocument-View association n Ready-to-use functions such asµ Undo-redoµ Save and open application dataFinally, you develop the application’s graphical user interface using the toolkit ofyour choice, for example:nKDE Qt or GNOME GTK+ on Linux nMicrosoft Foundation Classes (MFC) on Windows nMotif on Sun n Other commercial products such as Ilog ViewsYou can also implement the user interface in the Java language using the Swing-based Java Application Desktop component (JAD) provided with OCAF.Benefits of OCAFAs you use the architecture provided by OCAF, the design of your application ismade easy: the application developer concentrates on the functionality instead ofthe underlying mechanisms required to support this functionality.Also, thanks to the coupling with the other Open CASCADE modules, yourapplication can rapidly be prototyped. In addition, the final application can bedeveloped by industrializing the prototype — you don’t need to restart thedevelopment from scratch.Last but not least, you base your application on an Open Source component: thisguarantees the perenniality of your development.A Look Inside OCAF The Design of OCAFReference-key modelIn most existing geometric modeling systems, the data are topology driven. Theyusually use a boundary representation (BRep), where geometric models aredefined by a collection of faces, edges and vertices, to which application data areattached. Examples of data include:n a colorn a materialn information that a particular edge is blendedWhen the geometric model is parameterized, that is, when you can change thevalue of parameters used to build the model (the radius of a blend, the thicknessof a rib, etc.), the geometry is highly subject to change. In order to maintain theattachment of application data, the geometry must be distinguished from otherdata.In OCAF, the data are reference-key driven. It is a uniform model in whichreference-keys are the persistent identification of data. All accessible data,including the geometry, are implemented as attributes attached to reference-keys.The geometry becomes the value of the Shape attribute, just as a number is thevalue of the Integer and Real attributes and a string that of the Name attribute.On a single reference-key, many attributes can be aggregated; the application canask at runtime which attributes are available. For example, to associate a textureto a face in a geometric model, both the face and the texture are attached to thesame reference-key.© Open CASCADE S.A. 5A Look Inside OCAF© Open CASCADE S.A. 6Figure 2Topologydriven versus reference-key driven approachesTopology driven Reference-key drivenTopological namingReference-keys can be created in two ways:nAt programming time, by the application n At runtime, by the end-user of the application (providing that you include this capability in the application)As an application developer, you generate reference-keys in order to givesemantics to the data. For example, a function building a prism may create threereference-keys: one for the base of the prism, a second for the lateral faces and athird for the top face. This makes up a semantic built-in the application’s prismfeature. On the other hand, in a command allowing the end-user to set a textureto a face he/she selects, you must create a reference-key to the selected face if ithas not previously been referenced in any feature (as in the case of one of thelateral faces of the prism).When you create a reference-key to selected topological elements (faces, edgesor vertices), OCAF attaches to the reference-key information defining the selectedtopology — the Naming attribute. For example, it may be the faces to which aselected edge is common to. This information, as well as information about theevolution of the topology at each modeling step (the modified, newed and deletedfaces), is used by the naming algorithm to maintain the topology attached to thereference-key. As such, on a parameterized model, after modifying the value of aparameter, the reference-keys still address the appropriate faces, even if theirgeometry has changed. Consequently, you change the size of the cube shown inthe figure 2 above, the user texture stay attached to the right face.A Look Inside OCAF© Open CASCADE S.A. 7Note As Topological naming is based on the reference-key and attributes such asNaming (selection information) and Shape (topology evolution information),OCAF is not coupled to the underlying modeling libraries. The only modelingservices required by OCAF are the following:nEach algorithm must provide information about the evolution of the topology (the list of faces modified, newed and deleted by the algorithm)n Exploration of the geometric model must be available (a 3D model is made of faces bounded by close wires, themselves composed by a sequence of edgesconnected by their vertices)Currently, OCAF uses the Open CASCADE modeling libraries.Aggregation of attributesTo design an OCAF-based data model, the application developer is encouragedto aggregate ready-to-use attributes instead of defining new attributes byinheriting from an abstract root class.There are two major advantages in using aggregation rather than inheritance:n As you don’t implement data by defining new classes, the format of saved data provided with OCAF doesn’t change; so you don’t have to write the Saveand Open functionsnThe application can query the data at runtime if a particular attribute is available Summaryn OCAF is based on a uniform reference-key model in which:µ Reference-keys provide persistent identification of dataµ Data, including geometry, are implemented as attributes attached toreference-keysµ Topological naming maintains the selected geometry attached toreference-keys in parameterized modelsn In many applications, the data format provided with OCAF doesn’t need to be extendednOCAF is not coupled to the underlying modeling librariesA Look Inside OCAF© Open CASCADE S.A. 8The Data FrameworkData structureThe OCAF Data Framework is the Open CASCADE realization of the reference-key model presented in the previous paragraph. It implements the reference-key as label objects, organized in a tree structure characterized by the following features:nA document contains only one tree of labels nEach label has a tag expressed as an integer value unique at its level in the tree nA label is identified by a string — the entry — built by concatenation of tags from the root of the tree, for example [0:1:2:1]nAttributes are of a type identified by a universal unique identifier (GUID)n Attributes are attached to labels; a label may refer to many attributes as long as each has a different GUIDAs such, each piece of data has a unique persistent address made up of the document path, its entry and the GUID of its class.For example, an application for designing coffee machines first allocates a label for the machine unit. It then adds sub-labels for the main features (glass coffee pot, water receptacle and filter) which it refines as needed (handle and reservoir of the coffee pot and spout of the reservoir). You now attach technical data describing the handle — its geometry and color — and the reservoir — its geometry and material. Later on, you can modify the handle’s geometry without changing its color — both remain attached to the same label.Figure 3 below illustrates this data structure.A Look Inside OCAF© Open CASCADE S.A. 9Figure 3The data structure of the coffee machineThe nesting of labels is key to OCAF. This allows a label to have its own structurewith its local addressing scheme which can be reused in a more complexstructure. Take, for example, the coffee machine. Given that the coffee pot’shandle has a label of tag [1], the entry for the handle in the context of the coffeepot only (without the machine unit) is [0:1:1]. If you now model a coffeemachine with two coffee pots, one at the label [1], the second at the label [4] inthe machine unit, the handle of the first pot would have the entry [0:1:1:1] (asin the Figure 3 above) whereas the handle of the second pot would be[0:1:4:1]. This way, we avoid any confusion between coffee pot handles.Note The purpose of the label hierarchy is to provide the data with persistentaddresses. In particular, applications which show the end-user the data in a tree-list view do not display this hierarchy. For that, an attribute (TreeNode ) which youinsert in the data structure is provided.Compound documentsAs the identification of data is persistent, one document can reference datacontained in another document, the referencing and referenced documents beingsaved in two separate files.Lets look at the coffee machine application again. The coffee pot can be placed inone document. The coffee machine document then includes an occurrence — apositioned copy — of the coffee pot. This occurrence is defined by an XLinkattribute (the eXternal Link) which references the coffee pot of the first documentA Look Inside OCAF(the XLink contains the relative path of the coffee pot document and the entry ofthe coffee pot data [0:1]).Figure 4The coffee machine compound documentIn this context, the end-user of the coffee machine application can open thecoffee pot document, modify the geometry of, for example, the reservoir, andoverwrite the document without worrying about the impact of the modification inthe coffee machine document. To deal with this situation, OCAF provides aservice which allows the application to check whether a document is up-to-date.This service is based on a modification counter included in each document: whenan external link is created, a copy of the referenced document counter isassociated to the XLink in the referencing document. Providing that eachmodification of the referenced document increments its own counter, we candetect that the referencing document has to be updated by comparing the twocounters (an update function importing the data referenced by an XLink into thereferencing document is also provided).© Open CASCADE S.A. 10A Look Inside OCAF© Open CASCADE 11Transaction mechanismThe Data Framework also provides a transaction mechanism inspired from database management systems: the data are modified within a transaction whichis terminated either by a Commit if the modifications are validated or by an Abort ifthe modifications are abandoned — the data are then restored to the state it wasin prior to the transaction. This mechanism is extremely useful for:nSecuring editing operations (if an error occurs, the transaction is abandoned and the structure retains its integrity)n Simplifying the implementation of the Cancel function (when the end-user begins a command, the application may launch a transaction and operatedirectly in the data structure; abandoning the action causes the transaction toAbort)nExecuting Undo (at commit time, the modifications are recorded in order to be able to restore the data to their previous state) The transaction mechanism consists simply of managing a backup copy of attributes. During a transaction, attributes are copied before their firstmodification. If the transaction is validated, the copy is destroyed. If thetransaction is abandoned, the attribute is restored to its initial value (whenattributes are added or deleted, the operation is simply reversed).Transactions are document-centered, that is, the application starts a transaction on a document. So, modifying a referenced document and updating one of itsreferencing documents requires two transactions, even if both operations aredone in the same working session.Persistent Data StorageIn OCAF, persistence, that is, the mechanism used to save a document in a file,is based on an explicit formal description of the data saved.When you open a document, the application reads the corresponding file and firstcreates a memory representation of it. This representation is then converted tothe application data model — the OCAF-based data structure the applicationoperates on. The file’s memory representation consists of objects defined byclasses known as persistent. The persistent classes needed by an application tosave its documents make the application’s data schema. This schema defines theway the data are organized in the file — the format of the data. In other words, thefile is simply an ASCII dump of the persistent data defined by the schema, thepersistent data being created from the application data model during the saveprocess.Only canonical information is saved. As a matter of fact, the application datamodel usually contains additional data to optimize processing. For example, theA Look Inside OCAF© Open CASCADE S.A. 12persistent Bézier curve is defined by its poles, whereas its data model equivalentalso contains coefficients used to compute a point at a given parameter. Theadditional data is calculated when the document is opened.The major advantages of this approach are the following:n Providing that the data format is published, files created by OCAF-based applications can be read without needing a runtime of the application(openness)nAlthough the persistence approach makes the data format more stable,OCAF provides a framework for managing compatibility of data betweenversions of the application — modification of the data format is supportedthrough the versioning of schema.OCAF includes a ready-to-use schema suitable for most applications. However, itcan be extended if needed. For that, the only things you have to do are:nTo define the additional persistent attributes n To implement the functions converting these persistent attribute to and from the application data model.Note Applications using compound documents extensively (saving data in many fileslinked together) should implement data management services. As a matter offact, it’s out the scope of OCAF to provide functions such as:nVersion and configuration management of compound documents n Querying a referenced document for its referencing documentsIn order to ease the delegation of document management to a data managementapplication, OCAF encapsulates the file management functions in a driver (themeta-data driver). You have to implement this driver for your application tocommunicate with the data management system of your choice.。
open cascade occ 几何模型创建与删除操作Open Cascade Technology (abbreviated as OCC) is an open-source library that offers a wide range of functionalities for 3D geometric modeling. In this article, we will explore how to create and delete geometric models using OCC. We will provide a step-by-step guide to help you understand the process thoroughly.1. Introduction to Open Cascade Technology (OCC)Before diving into creating and deleting geometric models, let us have a brief overview of OCC. OCC is a powerful framework that provides tools for 3D modeling, visualization, and simulation. It is widely used in various industries like mechanical engineering, architecture, and computer graphics.2. Installing Open Cascade TechnologyTo get started with OCC, you need to install it on your system. OCC is available for Windows, Linux, and macOS. You can download the latest version from the official OCC website. Follow the installation instructions provided there to set up OCC on your machine.3. Setting up an OCC projectAfter the installation, let us begin by setting up a new OCC project. Create a new directory on your system and open your preferred Integrated Development Environment (IDE). We will assume you are using C++ for this article, but OCC also supports other programming languages like Java and C#.In your IDE, create a new project and configure it to include the OCC header files and link against the OCC library. Refer to the OCC documentation for detailed instructions on setting up the project in your specific IDE.4. Creating a geometric modelNow that we have a project set up, we can start creating geometric models. OCC provides a wide range of classes and functions to define and manipulate various geometric entities like points, lines, curves, and surfaces. Let's take a simple example of creating a 3D box.a. Include the necessary OCC header files in your source code: cpp#include <TopoDS_Shape.hxx>#include <BRepPrimAPI_MakeBox.hxx>#include <TopoDS.hxx>b. Write the code to create a box:cppTopoDS_Shape box = BRepPrimAPI_MakeBox(10.0, 20.0,30.0).Shape();In this code, we first declare a variable `box` of type`TopoDS_Shape`, which represents a generic shape in OCC. We then use the `BRepPrimAPI_MakeBox` class to create a box with dimensions 10.0 units in the X direction, 20.0 units in the Y direction, and 30.0 units in the Z direction. Calling the `Shape()` function on the `BRepPrimAPI_MakeBox` object returns the actual OCC shape.5. Modifying the geometric modelOnce we have created a geometric model, OCC allows us to modify it by adding, removing, or changing its components. Let's continue with the previous example of the box and demonstrate some modifications.a. Extend the code from step 4:cpp#include <BRepBuilderAPI_Transform.hxx>#include <gp_Trsf.hxx>...Create a transformation to move the box 5 units in the X directiongp_Trsf translation;translation.SetTranslation(gp_Vec(5.0, 0.0, 0.0));Apply the transformation to the boxBRepBuilderAPI_Transform transform(box, translation); TopoDS_Shape modifiedBox = transform.Shape();In this code, we include additional header files for transforming the shape. We create a `gp_Trsf` object `translation` that represents a translation transformation with a 5.0 unit displacement in the X direction. We then use the`BRepBuilderAPI_Transform` class to apply the translation to the `box` shape. Finally, calling the `Shape()` function on the transformed object returns the modified shape `modifiedBox`.6. Deleting a geometric modelTo delete or destroy a geometric model in OCC, we can simply release its memory by calling the appropriate OCC functions. Let's extend the previous example and demonstrate how to delete the shapes.a. Extend the code from step 5:cpp#include <TopExp.hxx>#include <ShapeFix_Shape.hxx>...Delete the modifiedBoxShapeFix_Shape::Disconnect(modifiedBox);Alternatively, delete all the components of modifiedBox explicitly TopExp_Explorer explorer(modifiedBox, TopAbs_FACE); ChangeTopAbs_FACE to the desired component typefor (; explorer.More(); explorer.Next()) {const TopoDS_Shape& component = explorer.Current();ShapeFix_Shape::Disconnect(component);}In this code, we include additional header files for exploring and disconnecting the components of the shape. We use the`ShapeFix_Shape` class to disconnect the components of the`modifiedBox` shape. This frees the memory associated with the shape and removes it from the geometric model.7. ConclusionIn this article, we have explored how to create and delete geometric models using Open Cascade Technology (OCC). OCC provides a powerful framework for 3D modeling and manipulation. By following the step-by-step guide provided, you should now have a good understanding of how to use OCC to create, modify, and delete geometric models. Practice these concepts with other types of entities and explore the vastcapabilities of OCC to enhance your 3D modeling projects.。
Red Hat OpenStack Platform 9Auto Scaling for Compute configure Auto Scaling in Red Hat OpenStack PlatformOpenStack TeamRed Hat OpenStack Platform 9 Auto Scaling for Compute configure Auto Scaling in Red Hat OpenStack Platform OpenStack Team********************Legal NoticeCopyright © 2017 Red Hat, Inc.The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.Linux ® is the registered trademark of Linus Torvalds in the United States and other countries. Java ® is a registered trademark of Oracle and/or its affiliates.XFS ® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.MySQL ® is a registered trademark of MySQL AB in the United States, the European Union and other countries.Node.js ® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.The OpenStack ® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.All other trademarks are the property of their respective owners.AbstractAutomatically scale out your Compute instances in response to system usage.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Table of Contents CHAPTER 1. CONFIGURE AUTO SCALING FOR COMPUTE 1.1. ARCHITECTURAL OVERVIEW 1.2. EXAMPLE: AUTO SCALING BASED ON CPU USAGE 1.3. EXAMPLE: AUTO SCALING APPLICATIONS 3339Table of Contents1Red Hat OpenStack Platform 9 Auto Scaling for Compute 2CHAPTER 1. CONFIGURE AUTO SCALING FOR COMPUTE CHAPTER 1. CONFIGURE AUTO SCALING FOR COMPUTEThis guide describes how to automatically scale out your Compute instances in response to heavy system usage. By using pre-defined rules that consider factors such as CPU or memory usage, youcan configure Orchestration (heat) to automatically add and remove additional instances as needed. 1.1. ARCHITECTURAL OVERVIEW1.1.1. OrchestrationThe core component behind auto scaling is Orchestration (heat). Orchestration allows you to define rules using human-readable YAML templates. These rules can assess Telemetry data beforedeciding to add additional instances. Then, once the activity has subsided, Orchestration can automatically remove any unneeded instances.1.1.2. TelemetryTelemetry does performance monitoring of your OpenStack environment, collecting data on CPU, storage, and memory utilization for instances and physical hosts. Orchestration templates examine Telemetry data when assessing whether to take any pre-defined action.1.1.3. Key TermsStack - A stack comprises all the resources necessary to operate an application. It can be assimple as a single instance and its resources, or as complex as multiple instances with all theresource dependencies that comprise a multi-tier application.Templates - YAML scripts that define a series of tasks for Heat to execute. For example, it ispreferable to use separate templates for certain functions:Stack Template - This is where you define thresholds that Telemetry should respond to, anddefine the auto scaling group.Environment Template - Defines the build information for your environment: which flavorand image to use, how the virtual network should be configured, and what software should beinstalled.1.2. EXAMPLE: AUTO SCALING BASED ON CPU USAGEIn this example, Orchestration examines Telemetry data, and automatically increases the number of instances in response to high CPU usage. A stack template and environment template are createdto define the needed rules and subsequent configuration. This example makes use of existing resources (such as networks), and uses names that are likely to differ in your own environment.1. Create the environment template, describing the instance flavor, networking configuration,and image type. Enter the following values in /etc/heat/templates/cirros.yaml: heat_template_version: 2014-10-16description: A base Cirros 0.3.4 serverresources:server:3Red Hat OpenStack Platform 9 Auto Scaling for Computetype: OS::Nova::Serverproperties:block_device_mapping:- device_name: vdadelete_on_termination: truevolume_id: { get_resource: volume }flavor: m1.nanokey_name: adminnetworks:- port: { get_resource: port }port:type: OS::Neutron::Portproperties:network: privatesecurity_groups:- allfloating_ip:type: OS::Neutron::FloatingIPproperties:floating_network: publicfloating_ip_assoc:type: OS::Neutron::FloatingIPAssociationproperties:floatingip_id: { get_resource: floating_ip }port_id: { get_resource: port }volume:type: OS::Cinder::Volumeproperties:image: 'Cirros 0.3.4'size: 12. Register the Orchestration resource in /root/environment.yaml:resource_registry:"OS::Nova::Server::Cirros":"file:///etc/heat/templates/cirros.yaml"3. Create the stack template, describing the CPU thresholds to watch for, and how manyinstances should be added. An instance group is also created, defining the minimum andmaximum number of instances that can participate in this template.Enter the following values in /root/example.yaml:heat_template_version: 2014-10-16description: Example auto scale group, policy and alarmresources:scaleup_group:type: OS::Heat::AutoScalingGroupproperties:cooldown: 60desired_capacity: 14CHAPTER 1. CONFIGURE AUTO SCALING FOR COMPUTE max_size: 3min_size: 1resource:type: OS::Nova::Server::Cirrosscaleup_policy:type: OS::Heat::ScalingPolicyproperties:adjustment_type: change_in_capacityauto_scaling_group_id: { get_resource: scaleup_group }cooldown: 60scaling_adjustment: 1scaledown_policy:type: OS::Heat::ScalingPolicyproperties:adjustment_type: change_in_capacityauto_scaling_group_id: { get_resource: scaleup_group }cooldown: 60scaling_adjustment: -1cpu_alarm_high:type: OS::Ceilometer::Alarmproperties:meter_name: cpu_utilstatistic: avgperiod: 60evaluation_periods: 1threshold: 50alarm_actions:- {get_attr: [scaleup_policy, alarm_url]}comparison_operator: gtcpu_alarm_low:type: OS::Ceilometer::Alarmproperties:meter_name: cpu_utilstatistic: avgperiod: 60evaluation_periods: 1threshold: 10alarm_actions:- {get_attr: [scaledown_policy, alarm_url]}comparison_operator: lt4. Update the Telemetry collection interval. By default, Telemetry polls instances every 10minutes for CPU data. For this example, change the interval to 60 seconds in/etc/ceilometer/pipeline.yaml:- name: cpu_sourceinterval: 60meters:- "cpu"sinks:- cpu_sink5Red Hat OpenStack Platform 9 Auto Scaling for Compute+--------------------------------------+-------------------------------------+-------------------+----------+---------+------------+--------------------------------+------------------+| Alarm ID | Name| State | Severity | Enabled | Continuous | Alarmcondition | Time constraints |+--------------------------------------+-------------------------------------+-------------------+----------+---------+------------+--------------------------------+------------------+| 04b4f845-f5b6-4c5a-8af0-59e03c22e6fa | example-cpu_alarm_high-rd5kysmlahvx | ok | low | True | True| cpu_util > 50.0 during 1 x 60s | None || ac81cd81-20b3-45f9-bea4-e51f00499602 | example-cpu_alarm_low-6t65kswutupz | ok | low | True | True| cpu_util < 10.0 during 1 x 60s | None |+--------------------------------------+-------------------------------------+-------------------+----------+---------+------------+--------------------------------+------------------+1.2.1. Test Auto Scaling InstancesOrchestration auto scales instances based on the cpu_alarm_high threshold. Once CPUutilization is above 50% instances will be scaled up, as set in the cpu_alarm_high definition:threshold: 50To generate CPU load, login to the instance and run the dd command:$****************************.122.232$ dd if=/dev/zero of=/dev/null &$ dd if=/dev/zero of=/dev/null &$ dd if=/dev/zero of=/dev/null &After running the dd commands, you can expect to have 100% CPU utilization in the cirros instance.After 60 seconds you should see that Orchestration has auto scaled the group to two instances: # nova list+--------------------------------------+-------------------------------------------------------+--------+------------+-------------+--------------------------------------+| ID | Name | Status | Task State | Power State | Networks|+--------------------------------------+-------------------------------------------------------+--------+------------+-------------+--------------------------------------+| 3f627c84-06aa-4782-8c12-29409964cc73 | ex-qeki-3azno6me5gvm-pqmr5zd6kuhm-server-gieck7uoyrwc | ACTIVE | - | Running |private=10.10.1.156, 192.168.122.234 || 0f69dfbe-4654-474f-9308-1b64de3f5c18 | ex-qeki-qmvor5rkptj7-krq7i66h6n7b-server-b4pk3dzjvbpi | ACTIVE | - | Running |private=10.10.1.157, 192.168.122.235 |+--------------------------------------+-------------------------------------------------------+--------+------------+-------------+--------------------------------------+After a further 60 seconds you will observe that Orchestration has auto scaled again to threeinstances. Since three is the maximum for this configuration, it will not scale any higher (as set inthe scaleup_group definition: max_size)# nova list+--------------------------------------+-------------------------------------------------------+--------+------------+-------------+--------------------------------------+| ID | Name | Status | Task State | Power State | Networks|+--------------------------------------+-------------------------------------------------------+--------+------------+-------------+--------------------------------------+| 3f627c84-06aa-4782-8c12-29409964cc73 | ex-qeki-3azno6me5gvm-pqmr5zd6kuhm-server-gieck7uoyrwc | ACTIVE | - | Running |private=10.10.1.156, 192.168.122.234 || 0e805e75-aa6f-4375-b057-2c173b68f172 | ex-qeki-gajdwmu2cgm2-vckf4g2gpwis-server-r3smbhtqij76 | ACTIVE | - | Running |private=10.10.1.158, 192.168.122.236 || 0f69dfbe-4654-474f-9308-1b64de3f5c18 | ex-qeki-qmvor5rkptj7-krq7i66h6n7b-server-b4pk3dzjvbpi | ACTIVE | - | Running |private=10.10.1.157, 192.168.122.235 |+--------------------------------------+-------------------------------------------------------+--------+------------+-------------+--------------------------------------+1.2.2. Automatically Scaling Down InstancesOrchestration automatically scales down instances based on the cpu_alarm_low threshold. In thisexample, the instances are scaled down once CPU utilization is below 10%. Terminate the runningdd processes and you will observe Orchestration begin to scale the instances back down.Stopping the dd processes causes the cpu_alarm_low event to trigger. As a result,Orchestration begins to automatically scale down and remove the instances:# ceilometer alarm-list+--------------------------------------+-------------------------------------+-------+----------+---------+------------+--------------------------------+------------------+| Alarm ID | Name | State | Severity | Enabled | Continuous | Alarm condition| Time constraints |+--------------------------------------+-------------------------------------+-------+----------+---------+------------+--------------------------------+------------------+| 04b4f845-f5b6-4c5a-8af0-59e03c22e6fa | example-cpu_alarm_high-rd5kysmlahvx | ok | low | True | True | cpu_util >50.0 during 1 x 60s | None || ac81cd81-20b3-45f9-bea4-e51f00499602 | example-cpu_alarm_low-6t65kswutupz | alarm | low | True | True | cpu_util <10.0 during 1 x 60s | None |+--------------------------------------+-------------------------------------+-------+----------+---------+------------+--------------------------------+------------------+After a few minutes you can expect to be back to a single instance, the minimum number of instances allowed in scaleup_group: min_size: 11.3. EXAMPLE: AUTO SCALING APPLICATIONSThe functionality described earlier can also be used to scale up applications; for example, a dynamic web page that be served by one of multiple instances running at a time. In this case, neutron can be configured to provide Load Balancing-as-a-Service, which works to evenly distribute traffic among instances.In the following example, Orchestration again examines Telemetry data and increases the number of instances if high CPU usage is detected, or decreases the number of instances if CPU usage returns below a set value.1. Create the template describing the properties of the load-balancer environment. Enter thefollowing values in /etc/heat/templates/lb-env.yaml:heat_template_version: 2014-10-16description: A load-balancer serverparameters:image:type: stringdescription: Image used for serverskey_name:type: stringdescription: SSH key to connect to the serversflavor:type: stringdescription: flavor used by the serverspool_id:type: stringdescription: Pool to contactuser_data:type: stringdescription: Server user_datametadata:type: jsonnetwork:type: stringdescription: Network used by the serverresources:server:type: OS::Nova::Serverproperties:flavor: {get_param: flavor}image: {get_param: image}key_name: {get_param: key_name}metadata: {get_param: metadata}user_data: {get_param: user_data}networks:- port: { get_resource: port }member:type: OS::Neutron::PoolMemberproperties:pool_id: {get_param: pool_id}address: {get_attr: [server, first_address]}protocol_port: 80port:type: OS::Neutron::Portproperties:network: {get_param: network}security_groups:- baseoutputs:server_ip:description: IP Address of the load-balanced server.value: { get_attr: [server, first_address] }lb_member:description: LB member details.value: { get_attr: [member, show] }2. Create another template for the instances that will be running the web application. Thefollowing template creates a load balancer and uses the existing networks. Be sure to replace the parameters according to your environment, and save the template in a file such as /root/lb-webserver-rhel7.yaml:heat_template_version: 2014-10-16description: AutoScaling RHEL 7 Web Applicationparameters:image:type: stringdescription: Image used for serversdefault: RHEL 7key_name:type: stringdescription: SSH key to connect to the serversdefault: adminflavor:type: stringdescription: flavor used by the web serversdefault: m2.tinynetwork:type: stringdescription: Network used by the serverdefault: privatesubnet_id:type: stringdescription: subnet on which the load balancer will belocateddefault: 9daa6b7d-e647-482a-b387-dd5f855b88efexternal_network_id:type: stringdescription: UUID of a Neutron external networkdefault: db17c885-77fa-45e8-8647-dbb132517960resources:webserver:type: OS::Heat::AutoScalingGroupproperties:min_size: 1max_size: 3cooldown: 60desired_capacity: 1resource:type: file:///etc/heat/templates/lb-env.yamlproperties:flavor: {get_param: flavor}image: {get_param: image}key_name: {get_param: key_name}network: {get_param: network}pool_id: {get_resource: pool}metadata: {"metering.stack": {get_param:"OS::stack_id"}}user_data:str_replace:template: |#!/bin/bash -vyum -y install httpd phpsystemctl enable httpdsystemctl start httpdcat <<EOF > /var/www/html/hostname.php<?php echo "Hello, My name is " .php_uname('n'); ?>EOFparams:hostip: 192.168.122.70fqdn: shortname: sat6web_server_scaleup_policy:type: OS::Heat::ScalingPolicyproperties:adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: webserver}cooldown: 60scaling_adjustment: 1web_server_scaledown_policy:type: OS::Heat::ScalingPolicyproperties:adjustment_type: change_in_capacityauto_scaling_group_id: {get_resource: webserver}cooldown: 60scaling_adjustment: -1cpu_alarm_high:type: OS::Ceilometer::Alarmproperties:description: Scale-up if the average CPU > 95% for 1 minute meter_name: cpu_utilstatistic: avgperiod: 60evaluation_periods: 1threshold: 95alarm_actions:- {get_attr: [web_server_scaleup_policy, alarm_url]} matching_metadata: {'er_metadata.stack': {get_param: "OS::stack_id"}}comparison_operator: gtcpu_alarm_low:type: OS::Ceilometer::Alarmproperties:description: Scale-down if the average CPU < 15% for 1 minutemeter_name: cpu_utilstatistic: avgperiod: 60evaluation_periods: 1threshold: 15alarm_actions:- {get_attr: [web_server_scaledown_policy, alarm_url]} matching_metadata: {'er_metadata.stack': {get_param: "OS::stack_id"}}comparison_operator: ltmonitor:type: OS::Neutron::HealthMonitorproperties:type: TCPdelay: 5max_retries: 5timeout: 5pool:type: OS::Neutron::Poolproperties:protocol: HTTPmonitors: [{get_resource: monitor}]subnet_id: {get_param: subnet_id}lb_method: ROUND_ROBINvip:protocol_port: 80lb:type: OS::Neutron::LoadBalancerproperties:protocol_port: 80pool_id: {get_resource: pool}lb_floating:type: OS::Neutron::FloatingIPproperties:floating_network_id: {get_param: external_network_id}port_id: {get_attr: [pool, vip, port_id]}outputs:scale_up_url:description: >This URL is the webhook to scale up the autoscaling group. Youcan invoke the scale-up operation by doing an HTTP POST to thisURL; no body nor extra headers are needed.value: {get_attr: [web_server_scaleup_policy, alarm_url]}scale_dn_url:description: >This URL is the webhook to scale down the autoscaling group.You can invoke the scale-down operation by doing an HTTP POST tothis URL; no body nor extra headers are needed.value: {get_attr: [web_server_scaledown_policy, alarm_url]}pool_ip_address:value: {get_attr: [pool, vip, address]}description: The IP address of the load balancing poolwebsite_url:value:str_replace:template: http://serviceip/hostname.phpparams:serviceip: { get_attr: [lb_floating,floating_ip_address] }description: >This URL is the "external" URL that can be used to access thewebsite.ceilometer_query:value:str_replace:template: >ceilometer statistics -m cpu_util-q er_metadata.stack=stackval -p 60 -a avgparams:stackval: { get_param: "OS::stack_id" }description: >This is a Ceilometer query for statistics on the cpu_util meterSamples about OS::Nova::Server instances in this stack. The -qparameter selects Samples according to the subject's metadata.When a VM's metadata includes an item of the form metering.X=Y,the corresponding Ceilometer resource has a metadata itemof theform user_metadata.X=Y and samples about resources so tagged canbe queried with a Ceilometer query term of the former_metadata.X=Y. In this case the nested stacks givetheir VMs metadata that is passed as a nested stackOpen Network → Load Balancers to view the load balancer:Click Members. This page displays the members of the load balancing pool; these are the instances to which the website traffic can be distributed. Note that a member will not have the Active status until the corresponding instance has been created, and Apache has been installed and configured.When the web server has started, the instance is visible as an active member of the load balancer:You are now able to access the web application at http://IP/hostname.php. You can expect to see output similar to the following:Hello, My name is we-zrwm-t4ezkpx34gxu-qbg5d7dqbc4j-server-mzdvigk2juglYou can now view the stack’s CPU performance data by running the Telemetry command from the stack overview in Dashboard. The command looks like the following:# ceilometer statistics -m cpu_util -qer_metadata.stack=8f86c3d5-15cf-4a64-b9e8-70215498c046 -p 60 -a avg1.3.1. Test Auto Scaling ApplicationsTo manually trigger application scaling, use the REST scale-up URL from the stack overview in Dashboard, or generate load by running a resource-intensive command on the initially deployedinstance.Or use it as a parameter on the curl command line:$ curl -X POST "scale-up URL"To artificially generate load, allocate a floating IP to the instance, log in to it with SSH, and run a command which will keep the CPU busy. For example:CHAPTER 1. CONFIGURE AUTO SCALING FOR COMPUTE17。
Open CASCADE基础介绍(1)一直在用OCC作项目,但这方面的中文资料很少,看来OCC在中国还不是十分普及;后来,项目中使用OCC和DirectX结合使用,取得了很好的效果;随着OCC6.3版本的推出,Open CASCADE在速度方面已有了很大的改变。
以下为一些OCC的基础知识,愿与各位OCC爱好者共同学习;一:OCC中的基础类:gp_Pnt在OCC中,gp_Pnt表示一个顶点,gp_Vec表示一个向量,可以用两个顶点来生成一个向量。
比如:gp_Pnt P1(0,0,0);gp_Pnt P2(5,0,0);gp_Vec V1 (P1,P2);向量有一个方法.IsOpposite(),可以用来测试两个向量的方向是相对还是平行;比如:gp_Pnt P3(-5,0,2);gp_Vec V2 (P1,P3);Standard_Boolean result =V1.IsOpposite(V2,Precision::Angular());另外向量还有一些重要方法:--Standard_Real Magnitude() const;计算向量的大小;--Standard_Real SquareMagnitude() const;计算向量的平方;--向量的加减乘除操作;--向量的单位化;--通过一个点,线,面得出其镜像的向量;--向量的旋转,平移,缩放;具体的函数名称可以看OCC的头文件说明;有时需要决定一组空间点是位于一个点;一条直线,或一个平面,或一个空间: OCC中提供了相应的算法;比如:TColgp_Array1OfPnt array (1,5); // sizing arrayarray.SetValue(1,gp_Pnt(0,0,1));array.SetValue(2,gp_Pnt(1,2,2));array.SetValue(3,gp_Pnt(2,3,3));array.SetValue(4,gp_Pnt(4,4,4));array.SetValue(5,gp_Pnt(5,5,5));GProp_PEquation PE (array,1.5 );if (PE.IsPoint()){ /* ... */} //是否是同一个点gp_Lin L;if (PE.IsLinear()) {L = PE.Line();} //是否位于一条直线上;if (PE.IsPlanar()){ /* ... */}//是否在一个平面内;if (PE.IsSpace()) { /* ... */}gp_Dir类:此类用来描述3D空间中的一个单位向量;常用方法:(1):IsEqual(const gp_Dir& Other,const Standard_Real AngularTolerance) const;两个单位向量是否相等;(2):IsNormal(const gp_Dir& Other,const Standard_Real AngularTolerance) const;两个单位向量的夹角是否是PI/2;(3):IsOpposite(const gp_Dir& Other,const Standard_Real AngularTolerance) const;两个单位向量是否方向相反;(4):IsParallel(const gp_Dir& Other,const Standard_Real AngularTolerance) const;两个单位向量夹角O或PI;(5):Angle(const gp_Dir& Other) const;求两个向量之间的夹角;(6):void CrossCross(const gp_Dir& V1,const gp_Dir& V2) ;计算三个向量之间的叉积;(7):Standard_Real Dot(const gp_Dir& Other) const;计算点积;(8):Standard_Real DotCross(const gp_Dir& V1,const gp_Dir& V2) const;计算叉积再点积;(9):gp_Dir Reversed() const;得到反方向,在OCC中用 gp_Lin2d 类,来生成一个二维空间的直线,有它的原点和单位向量;gp_Ax2d 类:通过原点和X方向单位和Y方向单位建立一个二维坐标系;利用sense参数可以决定是右手系还是左手系;可以利用平移、旋转、缩放、镜像来更改坐标系;类似地,gp_Ax3类:用来描述一个3D空间的坐标系。
矿产资源开发利用方案编写内容要求及审查大纲
矿产资源开发利用方案编写内容要求及《矿产资源开发利用方案》审查大纲一、概述
㈠矿区位置、隶属关系和企业性质。
如为改扩建矿山, 应说明矿山现状、
特点及存在的主要问题。
㈡编制依据
(1简述项目前期工作进展情况及与有关方面对项目的意向性协议情况。
(2 列出开发利用方案编制所依据的主要基础性资料的名称。
如经储量管理部门认定的矿区地质勘探报告、选矿试验报告、加工利用试验报告、工程地质初评资料、矿区水文资料和供水资料等。
对改、扩建矿山应有生产实际资料, 如矿山总平面现状图、矿床开拓系统图、采场现状图和主要采选设备清单等。
二、矿产品需求现状和预测
㈠该矿产在国内需求情况和市场供应情况
1、矿产品现状及加工利用趋向。
2、国内近、远期的需求量及主要销向预测。
㈡产品价格分析
1、国内矿产品价格现状。
2、矿产品价格稳定性及变化趋势。
三、矿产资源概况
㈠矿区总体概况
1、矿区总体规划情况。
2、矿区矿产资源概况。
3、该设计与矿区总体开发的关系。
㈡该设计项目的资源概况
1、矿床地质及构造特征。
2、矿床开采技术条件及水文地质条件。