Author Topic: Length of Solids revisited  (Read 3252 times)

0 Members and 1 Guest are viewing this topic.

SEANT

  • Bull Frog
  • Posts: 338
Length of Solids revisited
« on: February 21, 2008, 05:20:32 AM »
Here is a routine that employs some of the concepts described in these threads:

http://www.theswamp.org/index.php?topic=16754.0
http://www.theswamp.org/index.php?topic=20389.0

This routine does a reasonably good job measuring the lengths of arbitrarily aligned extruded solids.  An original orientation via ‘PrincipalDirection’ is refined with the generation of parallel section (virtual CAT scan) and centroid comparison.  This refinement is useful when querying extrusions with additional Booleans and/or slices -particularly at the ends.

There is also an attempt at Section recognition included within the routine.  If a “library” of Sections is pre-processed, the main routine will compare a 3D Solid section to this library and hopefully find a match.

The attached DWG includes some tagged sections (XData) and solids based on those sections.   To include a new section (as a Region entity), run the “SetRegData” routine.

This routine makes a few assumptions about the solid (specifically in the “Reorient” and “GenSection” subs).  Unfortunately, there seems to be a direct relationship between high confidence and time of execution.  The current level is a good trade off for my style of CAD work, though may be insufficient for more exacting design issues. 

Any suggestions to modify, eliminate, or reduce the quantity of these assumptions would be greatly appreciated.

Note: Code requires a reference to the appropriate Autocad/ObjectDBX library via VBAIDE-Tools-References
« Last Edit: February 21, 2008, 07:51:56 AM by SEANT »
Sean Tessier
AutoCAD 2016 Mechanical

SEANT

  • Bull Frog
  • Posts: 338
Re: Length of Solids revisited
« Reply #1 on: February 24, 2008, 07:09:43 AM »
Damn, this is a tough crowd! 

Certainly a crowd not readily impressed by unsolicited, Newt posted code structured to run on a 4 year old platform. :|
Sean Tessier
AutoCAD 2016 Mechanical

MP

  • Seagull
  • Posts: 17724
  • Have thousands of dwgs to process? Contact me.
Re: Length of Solids revisited
« Reply #2 on: February 24, 2008, 08:32:30 AM »
You may find that you post something here and not a peep will be made. A year goes by, maybe more and then the post is discovered and the gem it contains illuminated and high fives anted up. But it's not because "it's a tough crowd". Ignoring the issue of the shear volume of information posted to the swamp ... it's a busy, preoccupied, self absorbed crowd, because that's the nature of our careers and and vocations. It's also what programming specifically demands: focus and undivided attention. It's nothing against you, it's just the way it is.

So be patient, be content. Know that you've contributed something good, something valuable to the swamp encyclopedia, and are now part of this great collective body of work.

Subtitle: Work hard, the rewards always come (though not necessarily when, or in the form one anticipates).

:)
« Last Edit: February 24, 2008, 09:58:44 AM by MP »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

SEANT

  • Bull Frog
  • Posts: 338
Re: Length of Solids revisited
« Reply #3 on: February 24, 2008, 09:33:43 AM »
Point taken . . . . and appreciated. :-)
Sean Tessier
AutoCAD 2016 Mechanical

MP

  • Seagull
  • Posts: 17724
  • Have thousands of dwgs to process? Contact me.
Re: Length of Solids revisited
« Reply #4 on: February 24, 2008, 10:37:07 AM »
Truly my pleasure, co-author Sean.

:)

Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

SEANT

  • Bull Frog
  • Posts: 338
Re: Length of Solids revisited
« Reply #5 on: February 24, 2008, 11:07:14 AM »
Certainly a cool "high five". :lmao:
Sean Tessier
AutoCAD 2016 Mechanical

Bryco

  • Water Moccasin
  • Posts: 1851
Re: Length of Solids revisited
« Reply #6 on: February 25, 2008, 11:12:49 PM »
I've just given this a run, my computer at home has been acting up and I crashed on ("ObjectDBX.AxDbDocument.16") (17 for me).
Anyway it's very impressive, when I get a bit more time I'll try to figure out how you did it.

SEANT

  • Bull Frog
  • Posts: 338
Re: Length of Solids revisited
« Reply #7 on: February 26, 2008, 06:02:05 AM »
The attached module has several bug fixes.   A quick note, if the .bas extension is changed to .txt, it will allow a peek without requiring placement within a dvb.

I’ve also rearranged the subs to keep the most pertinent (i.e., non generic) ones towards the top, in the general order in which they are called.

The crux of the routine comprises the areas that make the most assumptions; ReOrient, Roll, and GenSection.  The parameters of these routines may require modification based on different industries.

With Autocad Mechanical, the Trans Matrix stuff would typically be handled by the GEAuto dll.  I suppose if my goal is to share, I’ll follow your’s (Bryco) and MickD’s lead and include that within the bas - once I get it all sorted out. 
Sean Tessier
AutoCAD 2016 Mechanical

MickD

  • Gator
  • Posts: 3434
  • (x-in)->[process]->(y-out)
Re: Length of Solids revisited
« Reply #8 on: February 26, 2008, 04:00:19 PM »
Yes Sean, as MP said, it's definitely not that we're not interested there isn't more involvement here.

I'd like to comment but I haven't had time to scratch myself lately, I'm sure it's top notch though from what I've seen of your previous works ;)
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

SEANT

  • Bull Frog
  • Posts: 338
Re: Length of Solids revisited
« Reply #9 on: February 27, 2008, 03:53:21 AM »
Thanks for the vote of confidence Mick.  It means a lot. 

P.S.  There are certain things that shouldn’t be left to chance.  You should really make plans to scratch. :-)
Sean Tessier
AutoCAD 2016 Mechanical