SEANT Posted January 3, 2010 Posted January 3, 2010 I find the Oriented Bounding Box (OBB) problem quite compelling. It has such widespread applicability that it justifies all the thought it can be given. It also seems to be the type of programming problem that could hinge on the perfect algorithm. I’m not sure, however, if even that would be 100% bulletproof (I think that is why MickD prefers the “data imbued at creation” methodology). Perhaps the biggest problem associated with a commercial OBB offering, then, would be determining at what point is the routine considered successful for any given industry. For my BOM requirements, for instance, the correct dims returned from the part illustrated in post #40 would be nice, though not absolutely necessary. It may even be more helpful for me if that solid were just flagged as indeterminate; it has other factors to consider beyond its length in I-beam. Those realities aside; programmers indulging their intellectual curiosity tend not to be satisfied with semi successful algorithms. Quote
SEANT Posted January 3, 2010 Posted January 3, 2010 Luis, that routine is working pretty well . . . . even with solids that are more complex than I would typically be concerned about. It is, however, tripping up one of the solids in the file I attached to post #15 of this thread. It’s interesting because that solid is not particularly complex. Perhaps therein lays a clue as to the type of algorithm you are using. Quote
LEsq Posted January 3, 2010 Posted January 3, 2010 Luis, that routine is working pretty well . . . . even with solids that are more complex than I would typically be concerned about. It is, however, tripping up one of the solids in the file I attached to post #15 of this thread. It’s interesting because that solid is not particularly complex. Perhaps therein lays a clue as to the type of algorithm you are using. Hi Sean, I'll have a look. Quote
LEsq Posted January 3, 2010 Posted January 3, 2010 Hi Sean, I'll have a look. OK, on a quick look, it appears the issue are the points, if you move that solid to the origin 0,0,0 from any of the bottom base points, you will see that it will output the right data. Since I am just working with points, it is interesting to see, as to why fails if those points are not way to far from the origin, this appears to be an issue with autocad coordinates precision, and something I suffer when wrote my gbpoly program for example - or it can be seen if one use bpoly function with very large coordinates. Will try to fix that - and also the box temp vectors, this needs more work for sure. Quote
LEsq Posted January 3, 2010 Posted January 3, 2010 I find the Oriented Bounding Box (OBB) problem quite compelling. It has such widespread applicability that it justifies all the thought it can be given. It also seems to be the type of programming problem that could hinge on the perfect algorithm. I’m not sure, however, if even that would be 100% bulletproof (I think that is why MickD prefers the “data imbued at creation” methodology). Perhaps the biggest problem associated with a commercial OBB offering, then, would be determining at what point is the routine considered successful for any given industry. For my BOM requirements, for instance, the correct dims returned from the part illustrated in post #40 would be nice, though not absolutely necessary. It may even be more helpful for me if that solid were just flagged as indeterminate; it has other factors to consider beyond its length in I-beam. Those realities aside; programmers indulging their intellectual curiosity tend not to be satisfied with semi successful algorithms. My reason to play with this and any other project, it is to learn something new, and also that could help me on possible future projects, that I might end working or even portions of the code. Many of the projects I wrote in the past, are now helping me to solve a lot of my actual tasks for my daily work - much easier. Quote
LEsq Posted January 3, 2010 Posted January 3, 2010 Luis, that routine is working pretty well . . . . even with solids that are more complex than I would typically be concerned about. It is, however, tripping up one of the solids in the file I attached to post #15 of this thread. Sean, I was able to did a quick fix and now appears to work for this case in particular - there is now an updated zip uploaded. Still it might fail with other solids - also there is some more work to do on this project. LE! Quote
wizman Posted January 4, 2010 Posted January 4, 2010 still fine in my few tests here ,Just curious LE, what is the principle involved in your code to get the bounding box(in layman's terms please)? Quote
LEsq Posted January 5, 2010 Posted January 5, 2010 still fine in my few tests here ,Just curious LE, what is the principle involved in your code to get the bounding box(in layman's terms please)? In one word: Experience And yes the project is not complete at all, for now it will put on hold, until I get the chance again to play a little more. LE! Quote
wizman Posted January 5, 2010 Posted January 5, 2010 Experience Good enough LE, hope to get there also someday Quote
mcampos700 Posted December 24, 2013 Posted December 24, 2013 Hello!The problem is: When i create a Box, then select it and click right mouse button and select properties menu, the window called Propertoes is displayed. This window have information about the box that is selected such as Length, heigh, width and so on... So i need to write VB application where i can store this parameters. I need to do this only with Box objects that are free oriented in a ModelSpace. Thank you for your advices! Sub teste() 'Dim objEnt As Acad3DSolid Dim varPick As Variant Dim LL As Variant Dim UR As Variant ThisDrawing.Utility.Prompt (vbln & vbln & "Dimentions: " & vbLf) 'On Error Resume Next counter = 0 For Each objEnt In ThisDrawing.ModelSpace If InStr(1, objEnt.EntityName, "3d") > 0 Then objEnt.GetBoundingBox LL, UR dim1 = Math.Round(UR(0) - LL(0), 3) dim2 = Math.Round(UR(1) - LL(1), 3) dim3 = Math.Round(UR(2) - LL(2), 3) If (dim1 If (dim2 > dim3) Then outStr = dim1 & "," & dim2 & "," & dim3 Else outStr = dim1 & "," & dim3 & "," & dim2 End If End If If (dim2 If (dim1 > dim3) Then outStr = dim2 & "," & dim1 & "," & dim3 Else outStr = dim2 & "," & dim3 & "," & dim1 End If End If If (dim3 If (dim1 > dim2) Then outStr = dim3 & "," & dim1 & "," & dim2 Else outStr = dim3 & "," & dim2 & "," & dim1 End If End If ThisDrawing.Utility.Prompt (outStr & vbLf) counter = counter + 1 End If Next ThisDrawing.Utility.Prompt ("Total: " & counter & " 3D objects found." & vbLf) End Sub Quote
SEANT Posted December 24, 2013 Posted December 24, 2013 mcampos700, nicely done. Welcome to the forum. Quote
RICVBA Posted December 24, 2013 Posted December 24, 2013 mcampos700, nicely done. Welcome to the forum. seems like this routine only deals with properly oriented 3d solids? is it right? Quote
SEANT Posted December 24, 2013 Posted December 24, 2013 That seems to be the case. A good start, though. Anyone attacking this via VBA has to be commended. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.