[Pythoncad-developer] Draw in oo mode
CAD Application entire developed in Python
Status: Beta
Brought to you by:
matteoboscolo
From: Paolo Z. <zam...@gm...> - 2010-05-15 06:02:03
|
Hi developers, Let read the follow idea! Some days ago I bring my chief a draw, and he told me: “next time it’s better if you bring me a white paper with some random lines on it, so I can fix them on it!”. All times I mind about a list of entities in a document I ask myself: Now who does fix them? All you know everything about the difference between procedural programming and object oriented programming. And no matter, it is most useful the second one. Then, why we draw in procedural mode instead of oo mode? Geometric entities in a draw are the same as the lines in a printed program. Even less complex ones. In fact if I change the order in a printed code line in a program the program won’t even start, instead if I change the order of the entities in a draw nothing wrong happens. The entities in a drow are free from semantics and structure! All of us think about 3D drawings as special ones because of are visual and recognizable. But 3D drawing is special because the designer build and handle objects, and the computer software manage them easily. If you want to do it in 3D you don’t need to do it. You can build, handle and manage objects even in 2D environment. The geometric entities are 1D objects in a 2D environment. The objects we can handle are 2D surfaces in a 2D environment. The surface is the result of a 1D entity closed frame. I mean “frame” as a chain of entities: the end point of an entity is the starting point of the next entity. In a surface you can describe an inside or an outside, a filled side or an empty side. And you can have a function applied to the surface. You can have a hole on a surface. Even you can hide a surface on others and sketch the shadow on it. You can link two surfaces, intersect, add or subtract each others. The final result of all these functions is the projection (view) of the physical object, and you can relate it with other projection of the same object. The projections are positioned on the sheet and dimensioned. You can’t handle 1D entities outside a surface because if you do it you would create a non sense. The designer just have to mind about draw surfaces instead of draw random entities. You can do even more Each function own the tree of functions who generate it. You can generate a function and figure again it’s projection. You can even change the input surfaces of the functions and figure again it’s projections. The surfaces patterns may be parametric, I change one parameter and figure again the relative projection. One projection may be set in relation to the others. In this way if you move or change the projection even the son projections move or changes. It’s a new world! Why do we go on as usual and manage a simple list of entities? Best regards.. Paolo Zambetti |