Thread: Re: [Pythoncad-developer] New kernel
CAD Application entire developed in Python
Status: Beta
Brought to you by:
matteoboscolo
From: Matteo B. <mat...@bo...> - 2010-03-02 17:08:57
|
Hi gertwing, We need to spatial queries like "give me all entities within (or outside) a rectangle", needed for a zoom or select functions. Or "give me the nearest entities from a given point", needed for snap and selection functions. ok May be you can create this structure in memory at startup looking of the bounding box . Let me know if having the bbox information in the entity table is still necessary .. > I don't' know how to improve this code > .. > > The name of the layer is inside > the pickle entity .. so I need to get all the layer and then ask to the > unpickle elemente the name .. > > We can store the entity type > with the name like this 'LAYER_MAIN' or "LAYER_PIPE" > but I do not like this sort of naming conversion for the entity type. > > Any idea? We must do the selection based on Id's. The id is the primary key and is indexed. When the drawing is opened PythonCAD retrieved all layers from the database, this is done by the pyKadKernel.getEntityFromType('LAYER'). The layer name is presented to the user, the record id is used internally by PythonCAD. When a single layer record is needed the id of the record is used to query the database. So instead of def getEntLayer(self, layerName) we use def getEntLayer(self, layerId) This way we make full use of the database indexes and it will be lightning fast. ok I was thinking to load in memory at startup all the layer tree for fast access to the data . and create a class for manage all the layers.. Regards, Matteo |
From: Yagnesh D. <yn...@gm...> - 2010-03-03 08:58:24
|
Were these queries not available in the R37 - - - - - - - - - - Best regards Yagnesh Desai Save a tree...please don't print this e-mail. On Tue, Mar 2, 2010 at 10:12 PM, Matteo Boscolo <mat...@bo...> wrote: > Hi gertwing, > > We need to spatial queries like "give me all entities within (or outside) a > rectangle", needed for a zoom or select functions. > Or "give me the nearest entities from a given point", needed for snap and > selection functions. > ok > > May be you can create this structure in memory at startup looking of the > bounding box … > > Let me know if having the bbox information in the entity table is still > necessary .. > > > >> I don’t’ know how to improve this code >> .. >> >> The name of the layer is inside >> the pickle entity .. so I need to get all the layer and then ask to the >> unpickle elemente the name .. >> >> We can store the entity type >> with the name like this ‘LAYER_MAIN’ or “LAYER_PIPE” >> but I do not like this sort of naming conversion for the entity type. >> >> Any idea? > > We must do the selection based on Id's. > The id is the primary key and is indexed. > > When the drawing is opened PythonCAD retrieved all layers from the database, > this is done by the pyKadKernel.getEntityFromType('LAYER'). > The layer name is presented to the user, the record id is used internally by > PythonCAD. > When a single layer record is needed the id of the record is used to query > the database. > > So instead of > def getEntLayer(self, layerName) > we use > def getEntLayer(self, layerId) > > This way we make full use of the database indexes and it will be lightning > fast. > ok > > I was thinking to load in memory at startup all the layer tree for fast > access to the data … and create a class for manage all the layers.. > > > > Regards, > > Matteo > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Pythoncad-developer mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncad-developer > > |
From: Matteo B. <mat...@bo...> - 2010-03-10 14:46:53
|
Hi Team, >From today Chris[chr...@gm...] will be part of our develop-team.. He had an experience of 12 years of Microstation and we do hope that he will help us in the developmet process of pythoncad .. Regards, Matteo -----Original Message----- From: Yagnesh Desai [mailto:yn...@gm...] Sent: 03 March 2010 09:58 To: pyt...@li... Subject: Re: [Pythoncad-developer] New kernel Were these queries not available in the R37 - - - - - - - - - - Best regards Yagnesh Desai Save a tree...please don't print this e-mail. On Tue, Mar 2, 2010 at 10:12 PM, Matteo Boscolo <mat...@bo...> wrote: > Hi gertwing, > > We need to spatial queries like "give me all entities within (or outside) a > rectangle", needed for a zoom or select functions. > Or "give me the nearest entities from a given point", needed for snap and > selection functions. > ok > > May be you can create this structure in memory at startup looking of the > bounding box … > > Let me know if having the bbox information in the entity table is still > necessary .. > > > >> I don’t’ know how to improve this code >> .. >> >> The name of the layer is inside >> the pickle entity .. so I need to get all the layer and then ask to the >> unpickle elemente the name .. >> >> We can store the entity type >> with the name like this ‘LAYER_MAIN’ or “LAYER_PIPE” >> but I do not like this sort of naming conversion for the entity type. >> >> Any idea? > > We must do the selection based on Id's. > The id is the primary key and is indexed. > > When the drawing is opened PythonCAD retrieved all layers from the database, > this is done by the pyKadKernel.getEntityFromType('LAYER'). > The layer name is presented to the user, the record id is used internally by > PythonCAD. > When a single layer record is needed the id of the record is used to query > the database. > > So instead of > def getEntLayer(self, layerName) > we use > def getEntLayer(self, layerId) > > This way we make full use of the database indexes and it will be lightning > fast. > ok > > I was thinking to load in memory at startup all the layer tree for fast > access to the data … and create a class for manage all the layers.. > > > > Regards, > > Matteo > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Pythoncad-developer mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncad-developer > > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Pythoncad-developer mailing list Pyt...@li... https://lists.sourceforge.net/lists/listinfo/pythoncad-developer |
From: <mat...@bo...> - 2010-03-03 09:38:21
|
Hi Yagnesh, Those query where available in the old version ...I whose using it for the snap feature without know it ..:-) We are just choose the think that are good in r37 for porting in r38 to have the best Pythoncad .. Regards, Matteo ----- Original Message ----- Da : Yagnesh Desai <yn...@gm...> A : pyt...@li... Oggetto : Re: [Pythoncad-developer] New kernel Data : Wed, 3 Mar 2010 14:28:15 +0530 > Were these queries not available in theR37- - - - - - - - > - -Best regardsYagnesh DesaiSave a tree...please don't > print this e-mail.On Tue, Mar 2, 2010 at 10:12 PM, Matteo > Boscolo<mat...@bo...> wrote:> Hi gertwing > ,>> We need to spatial queries like "give me all entities > within (or outside) a> rectangle", needed for a zoom or > select functions.> Or "give me the nearest entities from a > given point", needed for snap and> selection functions.> > ok>> May be you can create this structure in memory at > startup looking of the> bounding box â¦>> Let me know if > having the bbox information in the entity table is still> > necessary ..>>>>> I donâtâ know how to improve this > code>> ..>>>> The name of the layer is inside>> the pickle > entity .. so I need to get all the layer and then ask to > the>> unpickle elemente the name ..>>>> We can store the > entity type>> with the name like this âLAYER_MAINâ or > âLAYER_PIPEâ>> but I do not like this sort of naming > conversion for the entity type.>>>> Any idea?>> We > must do the selection based on Id's.> The id is the > primary key and is indexed.>> When the drawing is opened > PythonCAD retrieved all layers from the database,> this is > done by the pyKadKernel.getEntityFromType('LAYER').> The > layer name is presented to the user, the record id is used > internally by> PythonCAD.> When a single layer record is > needed the id of the record is used to query> the > database.>> So instead of> def getEntLayer(self, > layerName)> we use> def getEntLayer(self, layerId)>> This > way we make full use of the database indexes and it will > be lightning> fast.> ok>> I was thinking to load in memory > at startup all the layer tree for fast> access to the data > ⦠and create a class for manage all the layers..>>>> > Regards,>> Matteo>>>> > ---------------------------------------------------------- > --------------------> Download Intel® Parallel Studio > Eval> Try the new software tools for yourself. Speed > compiling, find bugs> proactively, and fine-tune > applications for parallel performance.> See why Inte l > Parallel Studio got high marks during beta.> > http://p.sf.net/sfu/intel-sw-dev> > _______________________________________________> > Pythoncad-developer mailing list> > Pyt...@li...> > https://lists.sourceforge.net/lists/listinfo/pythoncad-developer>>------------------------------------------------------------------------------Download > Intel® Parallel Studio EvalTry the new software tools > for yourself. Speed compiling, find bugsproactively, and > fine-tune applications for parallel performance.See why > Intel Parallel Studio got high marks during > beta.http://p.sf.net/sfu/intel-sw-dev_____________________ > __________________________Pythoncad-developer mailing > lis...@li...https://lists > .sourceforge.net/lists/listinfo/pythoncad-developer |
From: Matteo B. <mat...@bo...> - 2010-03-04 07:43:08
|
Hi Gerwin, I did the test ... > > So when we create a new entity instead > > of picling the array of point we will insert in a separate > table ..like > > this .. > > > > Id | idEnt | x | y | z > > > > I Will do some test to see what > > is fast … > > I am curious if it is faster. print Test with 10 entitys End time for nLoop 10 in 0.0 everage 0.0 End time for nLoop 10 in 0.01 everage 0.001 print Test with 100 entitys End time for nLoop 100 in 0.0 everage 0.0 End time for nLoop 100 in 0.05 everage 0.0005 print Test with 1000 entitys End time for nLoop 1000 in 0.05 everage 5e-05 End time for nLoop 1000 in 0.31 everage 0.00031 print Test with 1000 entitys End time for nLoop 1000 in 0.05 everage 5e-05 End time for nLoop 1000 in 0.34 everage 0.00034 print Test with 10000 entitys End time for nLoop 10000 in 0.52 everage 5.2e-05 End time for nLoop 10000 in 3.15 everage 0.000315 print Test with 100000 entitys End time for nLoop 100000 in 4.98 everage 4.98e-05 End time for nLoop 100000 in 31.43 everage 0.0003143 It seems that pickling is the best solution .. With for a single operation there is no difference.. but in case of massive operation like importing dxf picling is faster.. so i will let the kernel picking the points for the entitys .. Another good test will be to try to load the some entity and see what happen ... But i think that cPickling will be faster .. Regards, Matteo |