当前位置:文档之家› Object-oriented design for sparse direct solvers

Object-oriented design for sparse direct solvers

Object-oriented design for sparse direct solvers
Object-oriented design for sparse direct solvers

NASA/CR-1999-208978

ICASE Report No. 99-2

Object-oriented Design for Sparse Direct Solvers Florin Dobrian

Old Dominion University, Norfolk, Virginia

Gary Kumfert and Alex Pothen

Old Dominion University, Norfolk, Virginia

and

ICASE, Hampton, Virginia

Institute for Computer Applications in Science and Engineering

NASA Langley Research Center

Hampton, VA

Operated by Universities Space Research Association

OBJECT-ORIENTED DESIGN FOR SPARSE DIRECT SOL VERS?

FLORIN DOBRIAN?,GARY KUMFERT?,AND ALEX POTHEN?

Abstract.We discuss the object-oriented design of a software package for solving sparse,symmetric systems of equations(positive de?nite and inde?nite)by direct methods.At the highest layers,we decouple data structure classes from algorithmic classes for?exibility.We describe the important structural and algorithmic classes in our design,and discuss the trade-o?s we made for high performance.The kernels at the lower layers were optimized by hand.Our results show no performance loss from our object-oriented design,while providing?exibility,ease of use,and extensibility over solvers using procedural design.

1.Introduction.The problem of solving linear systems of equations Ax=b,where the coe?cient matrix is sparse and symmetric,represents the core of many scienti?c,engineering and?nancial applications. In our research,we investigate algorithmic aspects of high performance direct solvers for sparse symmetric systems,focusing on parallel and out-of-core computations.Since we are interested in quickly prototyping our ideas and testing them,we decided to build a software package for such experimentation.High performance is a major design goal,in addition to requiring our software to be highly?exible and easy to use.

Sparse direct solvers use sophisticated data structures and algorithms;at the same time,most software packages using direct solutions for sparse systems were written in Fortran77.These programs are di?cult to understand and di?cult to use,modify,and extend due to several reasons:First,the lack of abstract data types and encapsulation leads to global data structures scattered among software components,causing tight coupling and poor cohesion.Second,the lack of abstract data types and dynamic memory allocation leads to function calls with long argument lists,many arguments having no relevance in the context of the corresponding function calls.In addition,some memory may be wasted because all allocations are static.

We have implemented a sparse direct solver using di?erent programming languages at di?erent layers. We have reaped the bene?ts of object-oriented design(OOD)and the support that C++provides for OOD, at the highest layer,and the speed of Fortran77at the lower levels.The resulting code is more maintainable, usable,and extensible but su?ers no performance penalty over a native Fortran77code.To the best of our knowledge,this work represents the?rst object-oriented design of a sparse direct solver.

We chose C++as a programming language since it has full support for object-oriented design,yet it does not enforce it.The?exibility of C++allows a software designer to choose the appropriate tools for each particular software component.Another candidate could have been Fortran90,but it does not have inheritance and polymorphism.We need inheritance in several cases outlined later.We also wish to derive new classes for a parallel version of our code.We do not want to replicate data and behavior that is common to some classes.As for polymorphism,there are several situations when we declare just the interfaces in a base class and we want to let derived classes implement a proper behavior.

In this paper we present the design of our sequential solver.Work on a parallel version using the message-passing model is in progress.Object-oriented packages for iterative methods are described in[1,2].

2.Overview of the problem.Graph theory provides useful tools for computing the solution of sparse systems.Corresponding to a symmetric matrix A is its undirected adjacency graph G(A).Each vertex in the graph corresponds to a column(or row)in the matrix and each edge to a symmetric pair of o?-diagonal nonzero entries.

The factorization of A can be modeled as the elimination of vertices in its adjacency graph.The factorization adds edges to G(A),creating a new graph G+(A,P),where P is a permutation that describes the order in which the columns of A are eliminated.Edges in G+not present in G are called?ll edges and they correspond to?ll elements,nonzero entries in the?lled matrix L+D+L T that are zero in A.

The computation of the solution begins thus by looking for an ordering that reduces the?ll.Several heuristic algorithms(variants of minimum degree or nested dissection)may be used during this step.The result is a permutation P.

Next,an elimination forest F(A,P),a spanning forest of G+(A,P),is computed.The elimination forest represents the dependencies in the computation,and is vital in organizing the factorization step.Even though it is a spanning forest of the?lled graph,it can be computed directly from the graph of A and the permutation P,without computing the?lled graph.In practice,a compressed version of the elimination forest is employed.Vertices that share a common adjacency set in the?lled graph are grouped together to form supernodes.Vertices in a supernode appear contiguously in the elimination forest,and hence a supernodal version of the elimination forest can be used.

The factorization step is split in two phases:symbolic and numerical.The?rst computes the nonzero structure of the factors and the second computes the numerical values.The symbolic factorization can be computed e?ciently using the supernodal elimination forest.The multifrontal method for numerical factorization processes the elimination forest in postorder.Corresponding to each supernode are two dense matrices:a frontal matrix and an update matrix.Entries in the original matrix and updates from the children of a supernode are assembled into the frontal matrix of a supernode,and then partial dense factorization is performed on the frontal matrix to compute factor entries.The factored columns are written to the factor matrix,and the remaining columns constitute the update matrix that carries updates higher in the elimination forest.

Finally,the solution is computed by a sequence of triangular and diagonal solves.Additional solve steps with the computed factors(iterative re?nement)may be used to reduce the error if it is large.

When the coe?cient matrix is positive de?nite,there is no need to pivot during the factorization.For inde?nite matrices,pivoting is required for stability.Hence the permutation computed by the ordering step is modi?ed during the factorization.

Additional details about the graph model may be found in[3];about the multifrontal method in[4];and about inde?nite factorizations in[5].

3.Design of the higher layers.At the higher layers of our software,the goal was to make the code easy to understand,use,modify and extend.Di?erent users have di?erent needs:Some wish to minimize the intellectual e?ort required to understand the package,others wish to have more control.Accordingly, there must be di?erent amounts of information a user has to deal with,and di?erent levels of functionality a user is exposed to.

At the highest level,a user is aware of only three entities:the coe?cient matrix A,the right hand side vector b,and the unknown vector x.Thus a user could call a solver as follows:

x=Compute(A,b),

expecting the solver to make the right choices.Of course it is di?cult to achieve optimal results with such limited control,so a more experienced user would prefer to see more functionality.Such a user knows that the computation of the solution involves three main steps:(1)ordering,to preserve sparsity and thus to reduce work and storage requirements,(2)factorization,to decompose the reordered coe?cient matrix into a product of factors from which the solution can be computed easily,and(3)solve,to compute the solution from the factors.This user would then like to perform something like this:

P=Order(A),

(L,D,P)=Factor(A,P),

x=Solve(L,D,P,b).

Here,P is a permutation matrix that trades sparsity for stability,L is a unit lower triangular or block unit lower triangular matrix,and D is a diagonal or block diagonal matrix.

At this level the user has enough control to experiment with di?erent algorithms for each one of these steps.The user could choose a minimum degree or a nested dissection ordering,a left-looking or a multifrontal factorization.In addition,the user may choose to run some of the steps more than once to solve many related systems of equations,or for iterative re?nement to reduce the error.

We organized the higher layers of our software as a collection of classes that belong to one inheritance tree. At the root of the tree we put the Object class,which handles errors and provides a debugging interface. Then,since the two basic software components are data structures and algorithms,and since decoupling them achieves?exibility,we derived a DataStructure class and an Algorithm class from Object.The?rst one handles general information about all structural objects and the second one deals with the execution of all algorithmic objects.

An important observation is necessary here.While full decoupling needs perfect encapsulation,the overhead introduced by some interfaces may be too high.Thus performance reasons forced us to weaken the encapsulation allowing more knowledge about several objects.For sparse matrices,for example,we store the data(indices and values)column-wise,in a set of arrays.We allow other objects to retrieve these arrays,making them aware of the internal representation of a sparse matrix.We protect the data from being corrupted by providing non-const access only to functions that need to change the data.Such a design implementation may be unacceptable for an object-oriented purist.However,a little discipline from the user in accessing such objects is not a high price for a signi?cant gain in performance.

A user who does not want to go beyond the high level of functionality of the main steps required to compute the solution sees the following structural classes:SparseSymmMatrix,Vector,Permutation and SparseLwTrMatrix.The?rst class describes coe?cient matrices,the second right hand side and solution vectors,the third permutations,and the fourth both triangular and diagonal factors.We decided to couple these last two because they are always accessed together and a tight coupling between them leads to higher performance without any signi?cant loss in understanding the code.The derivation of these four classes from DataStructure is shown in Fig.3.1.

At the same level the user also sees several algorithmic classes.First there are various ordering algo-rithms,such as NestDissOrder or MultMinDegOrder.Then there are factorization algorithms,like PosDe-fLeftLookFactor,PosDefMultFrtFactor or IndefMultFrtFactor.Finally,the solve step can be performed by

DataStructure

SparseSymmMatrix Permutation SparseLwTrMatrix Vector

Fig.3.1.High level structural classes

Algorithm

MultMinDegOrder PosDefMultFrtFactor PosDefSolve

Fig.3.2.Some high level algorithmic classes

PosDefSolve or IndefSolve algorithms.Figure3.2describes the derivation of some of these classes from https://www.doczj.com/doc/492498483.html,ing them one can easily write a solver(positive de?nite,for concreteness)shown in Fig.3.

More details are available beyond this level of functionality.The factorization is split in two phases: symbolic and numerical.The symbolic factorization is guided by an elimination forest.The multifrontal method for numerical factorization uses an update stack and several frontal and update matrices,which are dense and symmetric.Pivoting strategies for inde?nite systems can be controlled at the level of frontal and update matrices during the numerical factorization phase.Figures3.4and3.5depict the derivation of the corresponding structural and algorithmic classes.

Classes such as SparseSymmMatrix,SparseLwTrMatrix,and Permutation are implemented with multiple arrays of di?ering sizes.Several of these are arrays of indices that index into the other arrays,so that the validity of the state of a class depends on not only the individual internal arrays,but the interaction between several of them.

In a conventional sparse solver,these arrays are global and some of them are declared in di?erent modules.A coe?cient matrix,a factor,a permutation,or an elimination forest is not a well de?ned entity but the sum of scattered data.This inhibits software maintenance because of the tight coupling between disparate compilational units.

There are also signi?cant bene?ts in terms of type safety.For instance,a permutation is often represented as an array of integers.It could be that the index of the old number holds the new position or vice versa. We use oldToNew and newToOld to refer to the two arrays.The problem is that interpreting a newToOld permutation as an oldToNew permutation yields a valid operation,though an incorrect permutation.It is easy for users to reverse these two,particularly when the names“permutation”and“inverse permutation”are applied since there is no agreement on whether newToOld is the former or the latter.Our Permutation class maintains both arrays internally and supplies each on demand.

4.Design of the lower layers.While the larger part of our code deals with the design of the higher layers,most of the CPU time is actually spent in few computationally intensive loops.No advanced software paradigms are needed at this level so we concentrated on performance by carefully implementing these loops.

A major problem with C++(also with C)is pointer aliasing,which makes code optimization more di?cult for a compiler.We get around this problem by making local copies of simple variables in our kernel code.Another source of performance loss is complex numbers,since they are not a built-in in C++

main()

{

/*Load the coefficient matrix and the right hand side vector.*/

SparseSymmMatrix a("a.mat");

Vector b("b.vec");

/*Reorder the matrix to reduce fill.*/

Permutation p(a.getSize());

MultMinDegOrder order(a,p);

order.run();

/*Factor the reordered matrix.*/

SparseLwTrMatrix l(a.getSize());

PosDefMultFrtFactor factor(a,p,l);

factor.run();

/*Solve triangular systems of equations.*/

Vector x(a.getSize());

PosDefSolve solve(l,p,b,x);

solve.run();

/*Save the solution.*/

x.save("x.vec");

}

Fig.3.3.A direct solver for sparse,symmetric positive de?nite problems at the highest level

DataStructure

ElimForest DenseSymmMatrix UpdateStack

FrontalMatrix

UpdateMatrix

Fig.3.4.Structural classes used by the multifrontal numerical factorization algorithms

data type as in Fortran.There is a template complex class in the Standard C++library.Though this gives the compiler enough information to enforce all the rules as if it were a built-in datatype,it does not (indeed cannot)give the compiler any information about how to optimize for this class as if it were a built-in datatype.

We implemented our computationally intensive kernels both in C++and Fortran77.A choice between these kernels and between real and complex arithmetic can be made using compile-time switches.We de?ned our own class for complex numbers but we make minimal use of complex arithmetic operators,which are

Algorithm

SymFactor IndefMultFrtNumFactor

PosDefMultFrtNumFactor

Fig.3.5.Some symbolic and numerical factorization algorithmic classes

Table5.1

Performance on an IBM RS/6000for three sets of problems from?uid dynamics and acoustics.The cputimes(in seconds) and performance for the numerical factorization step are reported.

Problem

grid9.63

16,12963,756552,871 1.7041.6

grid9.255

helmholtz0

16,64098,176639,364 4.7277.8

helmholtz2

e20r0000

9,661149,4161,133,759 6.5640.2

e40r0000

REFERENCES

[1]S.Balay,W.D.Gropp,L.C.McInnes,and B.F.Smith,E?cient management of parallelism

in object-oriented numerical software libraries,in Modern Software Tools in Scienti?c Computing, Birkhauser Press,1997.

[2]A.M.Bruaset and https://www.doczj.com/doc/492498483.html,ngtangen,Object-oriented design of preconditioned iterative methods

in Di?pack,ACM Trans.Math.Software(1997),pp.50–80.

[3]A.George and J.W.H.Liu,Computer Solution of Large Sparse Positive De?nite Systems,Prentice

Hall,1981.

[4]A.Pothen and C.Sun,A distributed multifrontal algorithm using clique trees,Technical Report

CS-91-24,Computer Science,Penn State,Aug.1991.

[5]C.Ashcraft,J.Lewis,and R.Grimes,Accurate symmetric inde?nite linear equation solvers,

Preprint,Boeing Information Sciences,1995.To appear in SIAM J.Matrix Analysis and its Appli-cations.

[6]E.Arge,A.M.Bruaset,and https://www.doczj.com/doc/492498483.html,ngtangen,Object-oriented numerics,in Numerical Methods

and Software Tools in Industrial Mathematics,Birkhauser,pp.7–26,1997.

[7]G.Booch,Object-Oriented Analysis and Design with Applications.Benjamin Cummings Publishing

Company,second edition,1994.

123DDesign实用详解(二)课案

123D Design实用详解(二) 移动和合并 今天开始学习简单模型制作和各个工作栏的部分应用,比如上一次说到的基本几何体,它是一个非常方便的实体模型,方便我们在创建模型中用到的 首先我们点开基本几何体工作栏 选择一个立方体, 当立方体拖放出来的时候(暂时不要点鼠标)屏幕下方出现一个对话框,分别为长,宽,高,设置选项,我们就按默认参数直接把立方体放入栅格上,切换设置参数可以按Tab 键,这个立方体是紧紧地吸附在栅格上的。 我们再拉入其它几个模型看看效果

感觉很棒吧,一下就进来了,好了,废话不多说了,开始熟悉各个菜单里的功能首先点一下立方体,如图 立方体四周变成绿色,辅助快捷栏出现,我们来试一下

点击移动按钮,如图出现白色箭头 可以移动模型的位置和旋转模型的角度 这个框里是输入你要移动的距离,每一个栅格的距离是5mm,可以手动拖动箭头移动,也可以直接点一下往那个方向移动,在右边的框里直接输入距离也可以。 当点击旋转按钮时,对话框里变为旋转角度是多少,同移动的性质是一样的,也可以直

接输入的。当确定了位置和角度的时候直接点击鼠标就完成这次命令。我在旋转里输入60出现了下图情况 点击确定得到相应角度的模型 这个时候你发现模型的下侧角是低于栅格的

我们可以使用移动来提升模型的高度,选择向上的箭头,直接输入4mm,模型的底边紧贴了栅格, 在提升模型的过程中,可左右切换角度来观察模型是否来到了栅格上。 我们再创建一个圆柱体,参数按默直径3mm,高8mm,我们试试把它放到这个立方体的仰面上看看是什么效果 当你移动鼠标接近立方体仰面的时候,圆柱体自动吸附到了这个模型的仰面上,点击鼠

面相中的十大凶相都有这些,你知道吗,看完该注意了

面相中的十大凶相都有这些,你知道吗,看完该注意了 谓的面相‘五官’,指的就是‘耳、眉、眼、鼻、口’等五种人体器官。面相就是一个人所具有的独特气质,而成为形或色表现于面上,给人的一种感受。接下来为大家详细介绍面相算命图解大全。面相可分为三庭看,人的眉以上是上庭,人的眉至鼻头是中庭,人的鼻头以下就为下庭。面部三庭要均匀。即额头、眉眼鼻、嘴与下巴的比例要均匀,整个面部显得大方磊落。若是额形生得略高阔饱满,则代表少年运佳,但额不能太高,过高会克夫,太低则少年运差,当然没法早嫁。在面部五官之后,再细分便是十二宫。这十二个宫位囊括了面部所有的特性和吉凶。第一宫:命宫,又为愿望之宫。麻衣曰:其居两眉间,山根之上,为印堂。第二宫:财帛宫,位于土宿,包括天仓、地库、金甲、井灶。主察财运。第三宫:兄弟宫,又称交友宫。麻衣曰:位居两眉。主交友运。第四宫:田宅宫,田宅宫,位于两眼,及上眼睑。主家业运第五宫:男女宫,又称子女宫。麻衣曰:位于两眼之下,又称为泪堂。看子嗣运。第六宫:奴仆宫,麻衣说它位居地阁,重接水星。看管理运。第七宫:妻妾宫,也可以称为夫妻宫,就在眼尾。第八宫:疾厄宫,一说是山根位,一说是年寿位,建议以鼻梁统看。第九宫:迁移宫,迁移者,位居眉角。古相士,以迁移宫的位置看人阴阳宅状况。第十宫:官禄宫,

官禄者,为居中正,上合离宫。反应人的禄命官运。第十一宫:福德宫,福德者,位居天仓,牵连地阁。看福禄之运。第十二宫:父母宫,便是额头的日月角。主看父母的福祸疾厄。看面相,形体外貌、精神气质、举止情态皆可一视而察,情人、恋人、夫妻、同事、朋友之间、感情总会有变化的、是相互信任、倾慕也可以从面相看出来。额头眉毛之间只有一道纵纹。这种面相在相学中被称为天柱纹。有此面相的人个性都很顽强。是属于做事不达目的绝不会放弃,对利益也是分得很清楚。一般来讲他们是不做对自己无利的事情。这样的人不但严以律己。同时对别人的要求也非常严格。但还有就是是这种面相的人有一个特征,那就好是这道纵纹平时是不会出现。当他的身心俱疲的时候,这道皱纹才会出现。鼻子的上部这些部位若是出现了数条横纹的人。有此面相特征者对事物都会表现出十足的热情。甚至可以说是充满激情。不仅是做事情又积极又主动。待人处事也是持着一颗平常心。此外,如果是说笑时出现这种皱纹的人。一般性格都是较为温和。缺点就是比较好管别人的事情。也常常为此惹祸上身。 1、男人的眉毛中间稀疏杂乱、毛形逆生,是为乱性之相, 情绪十分不稳定,伴有较重的暴力倾向。-2、双眉过低而压眼,是为心性阴沉扭曲而走极端。-3、女子眉过粗浓,不仅一生婚姻难成,且有妨夫。-4、印堂过窄小,难容两指的人,一生运势不顺且多灾厄。-5、女子双颧露骨而突起,对夫运

Autodesk 123D系列软件

Autodesk 123D系列软件 –适合初学者使用的免费3D建模软件 家用3D打印机使得人们能够简单的在家里生产自己想要的物体,但是3D建模仍然是个难题。那些应用于电影、游戏、工业设计的专业软件,体积庞大,价格昂贵,菜单选项让人目不暇接,学习曲线也陡峭的很,实在让人望而生畏。不过作为世界上数字设计领域最强大的成员,Autodesk 对此自然不能坐视不管,123D 系列就是他们推出的适合于初学者的、免费3D建模软件。 123D 家族现在主要有以下成员, 他们分别是, * 根据照片生成3D模型的『123D Catch』(平台:PC, iPad, iPhone, Web) * 可在多个平台上进行 CAD 建模的『123D Design』(平台:PC,Mac,iPad,Web) * 设计各种生物的『123D Creature』(平台:iPad) * 用于3D模型切片的『123D Make』(平台:PC,Mac,iPad,iPhone,Web) * 在iPad上进行3D雕塑的『123D Sculpt』(平台:iPad) 123D Catch 123D Catch 可以让你体验最方便的3D扫描。只需要几张不同角度的照片,123D Catch 就能构建出物体的3D模型。而且整个过程都是在云端完成的,是不是像变魔术一样?

123D Creature 123D Creature 让你可以在 iPad 上轻松的动动手指就能创造自己想象的生物。123D Creature 内建了各种皮肤材质以及3D骨骼,使得完成的模型栩栩如生,而且可以直接用来制作动画以及3D打印。

123D Design 与 123D 家族中其他成员偏重 CG 建模不同,123D Design 是个 CAD 建模软件。它通过简单直观的操作界面以及丰富的预定义零件,使得用户可以自由的建造精确模型,火车、房子、机器人,都不在话下。 123D Make 当你制作好一些不错的3D模型之后,你就可以利用123D Make来将它们制作成实物了。它能够将数字三维模型转换为二维切割图案,用户可利用硬纸板、木料、布料、金属或塑料等低成本材料将这些图案迅速拼装成实物,从而再现原来的数字化模型。

123D Design实用详解(12)

123D Design实用详解(十二) 修改工具 在前面我们已经讲过了倒圆角和倒斜角的操作,那么我们讲解修改栏中的其它命令操作按住并拖动 这里我们要区分一下拉伸命令,我们通过实例来区分拉伸和按住并拖动的区别 我们绘制一个圆形,选择拉伸命令,向上拉动5mm,通过操作拉伸命令的旋转,我们看到模型的顶部是会扩大和缩小的

同样我们选择修改栏中的按住并拖动命令,点击圆形,拖动向上的箭头,距离设置5,也点击旋转并拖动,同样地,顶部半径也是会扩大和缩小。 接下来,我们创建一个圆柱体,我们使用拉伸命令发现是可以拉伸圆柱体的,同样使用按住并拖动命令时也是这个样子,现在感觉这两个命令的作用是一样的,别急,我们再通过其它模型来试一下我们绘制一个楔形,并复制出一个

我们先选择拉伸命令,点击斜面拉伸,我们发现沿着斜面的垂直方向拉伸实体,我们再使用按住并拖动命令,点击另一个楔形的斜面,拖动箭头,这时,楔形只是水平向前拉伸。 调整命令 在123D中调整命令可以对实体模型的点,面,线进行移动和旋转操作,是十分灵活的,极大地提高了建模的灵活性。 我们通过实例来了解

创建一个立方体,我们通过调整命令, 点击一个顶点,四下拉动一下,发现这个正方体发生了变形 我们在点击其中的一个面来试下 我们拉动发现顶点是不变的,只是面进行了一个扭曲

这里注意一点,调整命令里是有三个选择的,分别是延伸、移动、三角化。在延伸模式下,受到拖动影响大的那个面会分割成三角形;在移动模式下,所有面是都不会分割的;而三角化模式下,在拖动顶点时非平移的面都分割为三角形。 调整命令在实际建模过程中,能够对构成实体的三种元素进行调节,应用的方法也非常灵活,可以在以后的建模过程中充分体现出来。 分割面 这个命令是可以对实体模型的一个面重新分割的 我们通过例子来理解这个命令格式 创建一个立方体,在立方体的顶面上画一条直线 选择分割面命令,在出现的功能对话框中,左边是选择想要分割的面,右边是选择想要去分割的图元

123D Design实用详解(九)

123D Design实用详解(九) 草绘变化 草绘栏里有四种常用的基本形状 我们可以根据这四种常用形状来绘制出不同的草绘,例如,我们绘制一个矩形,在矩形的边缘绘制一个圆形,利用草绘中剪裁命令,我们就可以得到一个新的草绘图形,如图

我们通过剪裁得到了矩形和圆形结合的图形,在今后的建模过程中,这样的例子还会很多,这里就不多解释了。 在草绘建模的过程中,我们还常用到阵列命令,作为绘制图形的一种方式。 阵列命令其实就是复制的一种,就是按照某种规则排列,生成大量形状相同或相近的对象,常用于创建数量较多、排列规则且形状相同的或相近的一组结构。

矩形阵列 我们通过实际绘制来理解这个命令。 首先绘制一个矩形,并在矩形内部绘制一个小圆形 点击小圆形出现齿轮图标,在图标中选择矩形阵列或在样式栏里选择矩形阵列。

我们选择了矩形阵列屏幕上出现一个小的对话框 左边是选择草绘图元(图形),右边是选择方向和数量。 我们点击圆形轮廓,就是选定了阵列图元(图形),这里要提示一下,当选择了圆形轮廓后,会出现这样一句话, 意思就是点击选择草图曲线或点 然后我们点击屏幕上右边的选择方向和数量,点击圆形左侧的线,会出现一个向下和向右的箭头,和一个对话框 这个对话框里有两个数值输入,一个是间隔距离,一个是数量,我们输入数量是3,向右拉动箭头

这样我们就拉出了3个小圆形,同理向下拉也是一样 这里说明一下,我们刚才绘制的这些圆形中,每个的中间都有一个这样的图标,点击这个图标,所绘制的这个圆形就会消失,同样再次点击会出现,还有这个图 标它是用来增减阵列的数量,按住它向右拉动鼠标,阵列的个数变为3个

123D Design建模学习

123D Design实例教程:初识123D 基本操作 3D打印要先用三维制图软件建模,就是画三维图,几款有名的三维制图软件相当强大,也就是相当难学的意思。对于非专业人士来说实在没必要为了体验3D而去啃。今天给大家介绍一个超级棒的软件:AUTO DESK 123D。 方法/步骤1 第一讲:认识界面:菜单,工具条,学会移动物体,放大缩小物体,旋转物体,拉出几个现成的零件。 1、认识界面 打开程序:点下方的Start a New Preject,开始新项目。 Tips:打开程序,就会出现一个简明教程,建议浏览一下,不想它下次再出现,就勾选左下角Don’t show,想看随时可以点右上角的“?”,点Quick Start tips。界面就是这样,上面一行图标,右边一条图标,中间一个淡蓝色的坐标(pan,托盘,就是工作台),有X轴和Y轴,坐标,相当简洁。 菜单在哪?对不起,没有我们熟悉的菜单,就是上面的图标。工具栏在哪?就是右边的一条图标。

方法/步骤2 2、放入物体 开始工作,放几个物体到台上: 点击红色选框:这是基本图元(Primitives),左边五个立体的,右边四个平面的。点中左边任一个,在蓝色的台上(pan)再点一下,就进来了,把立体的一个个点进来。如下图: 点进来的物体,都放在台上,都是贴紧台面放的。糟糕,放的乱七八糟的,那个圆环还放歪了,没在台面!

3、移动物体: 没关系,你可以点击拖动物体。好看多了,站在一条直线上了。 真的站在一条直线上了?不一定!记住,我们现在是画三维图,可是电脑屏幕是平面的(二维),所以我们看到的只是一个角度,这个角度是站在一条直线,换个角度就不一定了。不信你看其实是这样的:

123Ddisign建模教程(上)

初级建模教程《我的世界》系列建模

《我的世界》游戏与初级课程 《minecraft》(《我的世界》)是一款风靡全球的高自由度沙盒游戏,由瑞典Mojang AB 和4J Studios开发,于2009年5月13日发行。我的世界不同于其它游戏,更像是一种艺术和探索,我的世界中你能作做你想做的任何事,还能激发创造思维学习逻辑电路,是游戏中的乐高,相信多少年后都是经典中的经典。关键我的世界是探索不完的,是创造不完的,就不会有厌倦感,反而又更多的乐趣。 “Minecraft几乎不包含任何目前流行的游戏元素。Minecraft使用Java编写,具有极强的适应性,而且功能强大,整个游戏画面就像回到了上个世纪,看上去各种模糊和马赛克,就连人物也是一个方块盒子而已,但是却可以给玩家带来像是玩乐高积木一样的永久乐趣。” 就像上面说的一样,《我的世界》这款风靡全球的游戏简单易懂,可玩性高,没有上限的让你肆意挥洒想象力,只要你是玩家,你就是游戏世界的创造者,他们说这里有山,这里就有山,说那里有河,那里就有一条河。他们决定天空的颜色,决定河水的流动,决定鸟儿的歌唱,决定了游戏世界的光明与河岸,他们为玩家玩游戏做好了一切准备,玩家只需要点击鼠标就可以在游戏的虚拟世界中畅游。 Minecraft是一款让人类经历现实存在的游戏,不仅可以体验当王者的乐趣,还要承担管理世界的责任。我们的祖先就是在这种创造和残存中活下来的,而这条祖训现在搬上了电脑屏幕,但同样适用于现实。

同样,Minecraft也告诉整个游戏行业,只要游戏设计的足够好,游戏的价值就可以从玩乐提升到人类社会的高度。 基于这个众所周知的游戏,我们想把最简单也最吸引小学生年纪的《我的世界》主题3D建模作为开头的篇章。

123D Design实用详解

123D Design实用详解(三) 减去和相交 理解了合并命令后,我们来学习减去和相交命令,首先进入工作面,创建一个圆柱体, 尺寸按默认即可 再次创建一个圆柱体,我们设置为半径3,高度,20,并把新建的这个圆柱体放到先前建的圆柱体旁边 使两个圆柱体表面接触到一起,我们选择组合里的减去命令。 这里需要补充一句,你需要保存哪一个实体,就先选择哪一个实体作为目标实体,另一个实体则成为

按回车键,看看效果 源实体消失,剩下的就是被减去的目标实体。

我们再做一个实验,创建一个立方体,目的是要在立方体上做出一个圆孔,如图 首先创建立方体,尺寸按默认即可,再创建一个圆柱体,半径5,高20,把圆柱体放在立方体的顶面如图

为了确定是否放在立方体的顶面中间位置,我们可以选择视窗,切换合适的视窗位置,来确定摆放位 然后选择移动/旋转命令,点击圆柱体,向下移动20mm,可以看到整个圆柱体和立方体融合到一起,

确定位置后,点击组合,选择减去,点击目标实体立方体,再点击源实体,得到我们想要的模型,中我们做出这个模型后,也可以调整中间圆孔的大小,点击中间圆孔,出现齿轮图标 选择调整命令,和前面介绍到的移动/旋转一样,会出现带箭头的图标,我们可以左右拉箭头,看圆孔输入数值,我们把圆孔拉到立方体的一边

得到现在的样子 点击鼠标确认,就得到模型。当我们不想要这个圆孔的时候,我们只需要点击圆孔,有时需要多点击后,四周有绿色边框后,直接按删除键就可以删除了。 减去命令就是指目标实体被源实体挖去重叠的部分。 学会了减去命令后,我们来看下一个命令,相交。 我们创建一个圆锥体,直径设置5,高度设置30, 再创建一个立方体,设置为10,10,3 把立方体放到圆锥体的中间

123D Design实用详解(五)

123D Design实用详解(五) 倒角 123D Design在修改栏中有两种倒角命令,一个是倒圆角,另一个是倒斜角,通过这两个命令,来实现模型边缘的修饰。 倒圆角就是把3D模型的边缘,切削成指定半径的圆弧,而形成的圆角,我们通过一个模型来解释倒角命令。 我们选择基本几何体里的圆形图标,半径设置为20 把它放在栅格上,点击圆形,出现小齿轮图标,选择拉伸命令,设置10,如图

点击确认,得到一个圆柱体模型,点击右侧的导航工作栏,选择屏幕显示模式,选择隐藏草绘图形,如图 图中的草绘图形消失了。 再做一个圆形,设置半径为15,重复刚才拉伸命令操作,设置高为20,再执行隐藏草绘的操作,把它放到刚才做好的这个圆柱体实体顶面。

这里捎带介绍一下,视图切换,有可能第一次做放不到下面的这个实体中央,怎么办呢?我们可以切换视图来调整摆放的位置,选择正交视图,从顶面来看,基本可以更直观的找到位置的中心点。 我们再做一个圆环体,外径15,内径3,放到上面第二个圆柱体的顶端,选择移动/旋转命令,把圆环体往下拉,和圆柱体顶面持平。 现在做的这个像不像一个简单的底座呢,好了,我们选择第一个圆柱体的上侧边缘线

有可能是需要多点几次的,点击后出现齿轮图标,选择倒圆角,设置2 我们看一下效果怎么样,这里要注意一下,如果你设置的倒角参数过大的话,会出现下图的情况, 这是设置成为10,下面这个圆柱体的底边就看不出来了 我们再看一下倒斜角这个命令,同样,我们创建一个立方体,数值按默认的即可,选择

其中的一条边线,选择倒斜角命令,我们设置5,大家看一下效果 形成了一个45°的斜角,倒斜角这里说明一下,只要你选择倒斜角命令,软件里默认的设置是倒为45°的斜角。 当你把这个箭头一直下拉时,达到这个物体的极限时,是会提示非法操作的。我们再往下拉,形成图中的模型。 点击确认,我们再把其它的边做一下倒角,设置为2,看下效果。

123D Design实例教程

123D Design实例教程 一、基础操作 (2) 二、马克杯制作 (6) 三、收纳盒制作 (7) 四、笔筒的制作 (8) 五、名片盒设计 (9) 浙师大维实教育团队张克华 2017年11月14日

一、基础操作 一、123D 基本操作 认识界面:菜单,工具条,学会移动物体,放大缩小物体,旋转物体,拉出几个现成的零件。 打开程序:点下方的“开始新项目”。 Tips:打开程序,就会出现一个简明教程,建议浏览一下,不想它下次再出现,就勾选左下角Don’t show,想看随时可以点右上角的“?”,点Quick Start tips。 界面就是这样,上面一行图标,右边一条图标,中间一个淡蓝色的坐标(pan,托盘,就是工作台),有X轴和Y轴,坐标,相当简洁。菜单在哪?对不起,没有我们熟悉的菜单,

就是上面的图标。工具栏在哪?就是右边的一条图标。 2、放入物体 开始工作,放几个物体到台上: 点击红色选框:这是基本图元(Primitives),左边五个立体的,右边四个平面的。点中左边任一个,在蓝色的台上(pan)再点一下,就进来了,把立体的一个个点进来。如下图: 点进来的物体,都放在台上,都是贴紧台面放的。糟糕,放的乱七八糟的,有的没在台面! 3、移动物体

没关系,你可以点击拖动物体。好看多了,站在一条直线上了。 真的站在一条直线上了?不一定!记住,我们现在是画三维图,可是电脑屏幕是平面的(二维),所以我们看到的只是一个角度,这个角度是站在一条直线,换个角度就不一定了。 4、工作面操作 怎么会这样?你是怎么看的?这就要学会工作面的操作,很简单: 1、按住中键拖动鼠标,就能平移台面, 2、按住右键,拖动鼠标,就能改变视角, 3、滚动滚轮,就能缩放视图! 顺便告诉你,右边工具栏上也有这三个功能,不过在我看来是多余的,可能是为没中键的用户设计的吧。 可是我还是不知道是否在正上方观察的,说不定还是歪的。没关系,你注意工具条上面有个小方块,标明了top(顶视),left(左视),front(前视),点一下顶视就行了。注意:光标移到这个小方块上,左上角还会出现一个有用的按钮home(回到默认视图),点下试试。 5、全方位移动物体: 说的是,不但是歪的,而且悬在空中,我们要把它拉到台面,并且平躺。默认,我们只能在台的平面移动物体(X、Y轴),不能上下移动(Z轴)。为了说明问题,我们把所以物体都删除(点中物体,按键盘上的delete),留下一个圆环。 在物体上点击,下面出现一个菜单(如果没出现,先在空白处点击鼠标):

14种鼻型图解

26种面型算命图解 侧面观察 1、凸面型 上停位居前额,代表十五至三十岁、父母缘分、思想智慧等事。从侧面观看,这种面型的额头是向后倾斜,表示思想敏捷,下巴向后退缩,不是行动迅速。 但一个人思想、行动都迅速,则其人是一个容易冲动的人 2、凹面型 这种面型的人额头与下巴皆凸出,形成中央鼻子部位凹入 这种人思想、行动都慢;但有忍耐力,不会轻易冲动,给人感觉城府很深,不轻易向他人吐露心声。 3、直面型 直面形是前额与下巴皆没有凸出或退缩,这种面型的人思想与行动都不会急躁或太慢,做任何事都会按部就班,从容面对。 4、额凸下巴退缩 额凸代表思想慢,下巴退缩则代表行动快。 这种面相的人思想慢而行动快,其行动往往未经深思熟虑,所以常有错误的抉择。 5、额斜下巴凸

额斜是思想迅速,下巴凸出是行动缓慢,这种人碰到任何问题都会立即得到思想是回应,但不会马上行动,而会慢慢地行动,大部分人都是这种下巴。 正面观察 正面观察面型的方法较侧面多,有西洋骨相学的三分法,中国的五分法、十分法 其实三分法与五分有许多相同之处,三分法是以人类的思想、行动、物欲享受划分种类,而十分法只是把三分发再细致分划为十种。 三分法 1、思想型 思想型的人其特点是上额广阔而高,下巴尖而小,形成一个倒三角形。 这种形格的人身材一般都属细小、腰部狭窄、手一般略长、面色带白、头发幼而密。 「思想型」这正是推动他们走向成功之路的因素;所以很多科学家、研究家在未成功之前常常会给人行为疯狂、不切实际之感觉。 这种形格的人适宜做科学研究、教育、建筑师、设计师或数学家、分析家等工作。 2、运动型

运动型的人特点就是颧骨高耸,鼻形长而鼻梁有节,腮骨显露,前额一般较低而额上有横纹、面色带黑、头发粗而多、身材高大强壮。其性格特点是忍耐力强,有冒险精神,有责任心,敢作敢为,刻苦耐劳。 这种面型的人最适合从事劳动工作,如工程师、冒险家、探险家、军人、警察或运动员等 3、享受型 享受型的人其特点是颐部园肥,前额较窄小,形成一个正三角形或圆形的面。鼻形较小,鼻头园而有肉,头发幼而疏,面色略微带红,手脚较短,脸部特别肥大,肉多骨少。 这种人处事圆滑,交际手腕强。这种人最适合经商 以上三种形质,只是基本形而已。因为每一个人同样会兼有思想型、运动型及享受型的特征,只是多寡而已,但最好是三种形质发展平衡,这样可工作不忘娱乐,娱乐不忘工作。 如果思想型过重的话,这种人每天只是充满幻想,不肯面对现实,容易引发神经衰落及头痛病等病症,如果再加上整个脸型搭配失宜,如眉粗,眼无神,鼻形短,这样的话,实际谋生能力多有问题。 如果运动型过重的话,则其人精力充沛,行事冲动,喜欢用武力解决问题。如果再加上形质配合不佳,如鼻形不端正,额骨凸露或低,眼神流露等,则其人大多从事低下的劳动工作,只能温饱而已,老来

相关主题
相关文档 最新文档