Thread: Re: [Pythoncad-developer] Proposal geometry objects
CAD Application entire developed in Python
Status: Beta
Brought to you by:
matteoboscolo
From: <ger...@gm...> - 2010-02-05 11:58:08
|
Hi Matteo, Step 1: The list of entities. This are just remarks, maybe I see it wrong. 2) We can eliminate Segment, a segment is just a polyline with two points. There must be a tool for the user to create it. 11) Is Polygon/Rectangle needed, this is a special form of a polyline. There must be a tool for the user to create it. Internal it is a (closed) polyline. 13) + 14) + 15) + 16) These are all the same. A symbol itself is a entity. A Marker, Arrow, section symbol and a Welding symbol are two instances of the same symbol entity. We need symbol definitions that defines how the symbol looks like. And we need symbol references that is a instance of the symbol definition. 18) Is layer an entity? I thought it is more a entity attribute. A layer itself has no visible representation. 19) Is Label not the same as text? What is the difference? 20) What is a Ballon? I think we should keep the list of entities as short as possible. Each entity will cost us time to implement (object definition + drawing + printing). We allway can provide different tools to the user. Regards, Gertwin Op schreef Matteo Boscolo <mat...@bo...>: > Hi Gertwing, > I like your structure because we can store in a row of db a > tuple that indicate the points and the kind of object that we are going to > store. > The db entity could be in case of point > Id ++ coordinate ++ type > 01 ++ (10,10)++ point > 02 ++ (10,10,20,20)++Segment > And so on for all the entity > We can go on with this step: > 1) > Get a full list of the entity that we need do describe > 2) > Create a sort of classes that try to describe all this entity > 3) > Create the simple and efficient way to store in on db > 4) > Start to convert pythoncad entity to the new entity > I would like to go on with this step before of all. > So start listing all the entity that we will need in pythoncad > 1) > Point > 2) > Segment > 3) > Circle > 4) > Arc > 5) > Ellipse > 6) > Nurbs > 7) > Polyline > 8) > Hatch > 9) > Text > 10) > Image > 11) > Polygon (triangle/rectangle….) > 12) > Dimension > 13) > Arrow > 14) > Marker > 15) > Section symbol > 16) > Welding symbol > 17) > Groups > 18) > Layer > 19) > Label > 20) > Ballon > 21) > … > Regards > Matteo > From: > ger...@gm... [mailto:ger...@gm...] > Sent: 04 February 2010 22:39 > To: pythoncad-developer > Subject: [Pythoncad-developer] Proposal geometry objects > Hi all, > I did some thinking about the entity geometry. > The current version maintains one point list where all entities make use > of. > I want to preserve this method because it has some advantages. > But I want to change the way the entities use these points. > The current version defines different geometries for each entity (segment, > polyline, arc, etc.). > I want to define only two different geometry objects that all entities can > share. > It consist of only points, no start-, end angles, center points or radius. > Because there are only points in the geometry transformations can be done > really quick, all points are multiplied by the same matrix. > If needed the program must calculate the center point, radius and angles > of > circles and arcs. > This is done far less often than entity drawing so this is more efficient. > The main advantage is creating point lists for cairo drawing is more easy. > All entities share the same geometry class, a single function is used to > draw them > all. > It is more easy to optimize a single draw function for speed than all > different > functions for all entities. > This excludes hatches of course which will have it own draw function. > Some preliminary code: > class Point(object): > """ > Indicates a single point with x and y ordinates (2D point) > The interpretation indicates how the connection is drawn to the next > point. > With this construction linear and circular lines are constructed. > These point objects are stored in a single table in the database. > """ > def __init__(self): > # id of point > self.__id = 0 > # X ordinate > self.__x = 0.0 > # Y ordinate > self.__y = 0.0 > # interpretation connection to next point > # L = linear > # C = circular > # None = not used (single point geometry) > # more interpretation values needed for dimensions? > self.__interpretation = 'L' > class SGeometry(object): > """ > Indicates a single geometry. > This is used in segment, polyline, arc, circle. > examples: > 1) A segment geometry consists of a list of two points. > The point interpretation from the first to the second point is 'L' > (linear) > 2) An arc geometry consists of a list of three points. > The first point is the start point of the arc, the second point is on the > arc > and the third point is the end point. > The point interpretation from the first to the second point is 'C' > (circular) > The point interpretation from the second to the third point is 'C' > (circular) > 3) An polyline consists of a list of three or more points. > The point interpretation can be 'L' (linear) or 'C' (circular) > This gives the opportunity to create polylines with linear and arc > segments. > 4) An circle geometry consists of a list of five points. > A circle is represented as two arcs where the first and fifth point are > the > same. > The point interpretation from the first to the second point is 'C' > (circular) > The point interpretation from the second to the third point is 'C' > (circular) > For a single geometry the geometry interpretation is None. > Interpretation is used for complex geometries. > """ > def __init__(self): > # list of points ids > self.__point_ids = [] > # interpretation used in complex geometry > # O = outer ring > # I = inner ring > # None = not used. > self.__interpretation = None > class CGeometry(object): > """ > Indicates a complex geometry. > This is used in hatches. > A hatch can contain islands. > The list contains a outer ring and a inner ring (island). > The rings are closed polylines (SGeometry objects). > ??? Can inner rings contain other inner rings (nested islands) ??? > """ > def __init__(self): > # list of single geometries. > # order in the list is important, first a outer ring, than the inner rings > self.__sgeometries = [] > Even a text can have the same geometry as a segment (two points). > The first point is the text location, the second point is the rotation. > The distance between the first and second point is the text height. > Regards, > Gertwin |
From: Matteo B. <mat...@bo...> - 2010-02-07 08:50:52
|
> 11) Is Polygon/Rectangle needed, this is a special form of a polyline. > There must be a tool for the user to create it. > Internal it is a (closed) polyline. ok but tu store this like polilyne we will have some trouble during filler or trim operation so will be better to have four Segment instead > 13) + 14) + 15) + 16) These are all the same. > A symbol itself is a entity. > A Marker, Arrow, section symbol and a Welding symbol are two instances > of the same symbol entity. > We need symbol definitions that defines how the symbol looks like. > And we need symbol references that is a instance of the symbol > definition. > > 18) Is layer an entity? > I thought it is more a entity attribute. > A layer itself has no visible representation. > 19) Is Label not the same as text? > What is the difference? For my point of view label is a text with an arrow > 20) What is a Ballon? Ballon is a number of letter inside a circle or a square with an arrow attached that indicate the position of the ballon it's used for mark a group/block 21) titleblok 22) part list this two culd be a block rapresentation > > I think we should keep the list of entities as short as possible. this is right, what I want to do with this list is to define all the entity that we want to support in pythoncad and find for each of it the right rappresentation. It'like a brain storming to do not miss any entity and have the right solution for pythoncad. so as i suggest in the starting mail, Those are the step to go on with new kernel implementation: 1) get a list of all the entity that we need in pythoncad 2) describe it with a schema like you have done in this e-mail 3) describe how any entity will be described in the database 4) start create the kernel with the database 5) start convert pythoncad for the new kernel may be is better to create in the wiki all the entity that we will be support . Any Comment ? Regards, Matteo |
From: Yagnesh D. <yn...@gm...> - 2010-02-07 11:05:09
|
Friends; Going forward since we will be changing most of the codes. I suggest as a milestone we must always host the working code of PythonCAD R38 (Debugged). This will very well honour the efforts made by Art Hass and his team. -- Best regards Yagnesh Desai Save a tree...please don't print this e-mail. |
From: <ger...@gm...> - 2010-02-07 15:40:04
|
I think that will be R37, in R38 we have already started a restructuring. R37 is the last release version of the "original" PythonCAD. Regards, Gertwin Op schreef Yagnesh Desai <yn...@gm...>: > Friends; > Going forward since we will be changing most of the > codes. I suggest as a milestone we must always host > the working code of PythonCAD R38 (Debugged). > This will very well honour the efforts made by Art Hass and > his team. > -- > Best regards > Yagnesh Desai > Save a tree...please don't print this e-mail. > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the > business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Pythoncad-developer mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncad-developer |
From: Matteo B. <mat...@bo...> - 2010-02-07 17:17:48
|
I agree with Gertwing R37 is the last release .. Regards, Matgeo On Sun, 2010-02-07 at 15:39 +0000, ger...@gm... wrote: > I think that will be R37, in R38 we have already started a > restructuring. > R37 is the last release version of the "original" PythonCAD. > > Regards, > Gertwin > > > Op schreef Yagnesh Desai <yn...@gm...>: > > Friends; > > > > > > > > Going forward since we will be changing most of the > > > > codes. I suggest as a milestone we must always host > > > > the working code of PythonCAD R38 (Debugged). > > > > > > > > This will very well honour the efforts made by Art Hass and > > > > his team. > > > > > > > > -- > > > > Best regards > > > > > > > > Yagnesh Desai > > > > > > > > Save a tree...please don't print this e-mail. > > > > > > > > > ------------------------------------------------------------------------------ > > > > The Planet: dedicated and managed hosting, cloud storage, colocation > > > > Stay online with enterprise data centers and the best network in the > business > > > > Choose flexible plans and management services without long-term > contracts > > > > Personal 24x7 support from experience hosting pros just a phone call > away. > > > > http://p.sf.net/sfu/theplanet-com > > > > _______________________________________________ > > > > Pythoncad-developer mailing list > > > > Pyt...@li... > > > > https://lists.sourceforge.net/lists/listinfo/pythoncad-developer > > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ Pythoncad-developer mailing list Pyt...@li... https://lists.sourceforge.net/lists/listinfo/pythoncad-developer |
From: Yagnesh D. <yn...@gm...> - 2010-02-08 10:01:43
|
R37 is Ok But we must do some debug of current R37 so that people can install, try it and at least have feeling that "PythonCAD does works" As we will not be releasing soon something based on latest concept. Also we have now moved back from alpha to planning. - - - - - Best regards Yagnesh Desai Save a tree...please don't print this e-mail. |
From: <ger...@gm...> - 2010-02-07 15:58:19
|
OK, I see what a balloon is. We can implement this as a block that contains a attribute variable. I agree with you that we first do brainstorming about what entities to support and later decide how to implement these entities. Yes please add a page to the wiki with all entities. Maybe it is useful to create a link for each entity to its own page. On that page we can describe this entity (functionality, how it is implemented, etc.). This can also act as documentation for new developers. Regards, Gertwin Op schreef Matteo Boscolo <mat...@bo...>: > > 11) Is Polygon/Rectangle needed, this is a special form of a polyline. > > There must be a tool for the user to create it. > > Internal it is a (closed) polyline. > ok but tu store this like polilyne we will have some trouble during > filler or trim operation > so will be better to have four Segment instead > > 13) + 14) + 15) + 16) These are all the same. > > A symbol itself is a entity. > > A Marker, Arrow, section symbol and a Welding symbol are two instances > > of the same symbol entity. > > We need symbol definitions that defines how the symbol looks like. > > And we need symbol references that is a instance of the symbol > > definition. > > > > 18) Is layer an entity? > > I thought it is more a entity attribute. > > A layer itself has no visible representation. > > 19) Is Label not the same as text? > > What is the difference? > For my point of view label is a text with an arrow > > 20) What is a Ballon? > Ballon is a number of letter inside a circle or a square with an arrow > attached that indicate the position of the ballon > it's used for mark a group/block > 21) titleblok > 22) part list > this two culd be a block rapresentation > > > > I think we should keep the list of entities as short as possible. > this is right, > what I want to do with this list is to define all the entity that we > want to support in pythoncad and find for each of it the right > rappresentation. > It'like a brain storming to do not miss any entity and have the right > solution for pythoncad. > so as i suggest in the starting mail, > Those are the step to go on with new kernel implementation: > 1) get a list of all the entity that we need in pythoncad > 2) describe it with a schema like you have done in this e-mail > 3) describe how any entity will be described in the database > 4) start create the kernel with the database > 5) start convert pythoncad for the new kernel > may be is better to create in the wiki all the entity that we will be > support . > Any Comment ? > Regards, > Matteo |