Author Topic: Changing BoundingBox mystery  (Read 385 times)

0 Members and 1 Guest are viewing this topic.

LogicTools

  • Newt
  • Posts: 36
Changing BoundingBox mystery
« on: March 08, 2024, 10:16:27 AM »
There is a BoundingBox mystery when making a subtraction on a 3dsolid from another.

Open Z_test.dwg file and run this code:

Code - Auto/Visual Lisp: [Select]
  1. (defun show_bound_points  (/ e_list obj mi_pnt ma_pnt minExt maxExt b_points)
  2.  (setq
  3.   e_list (entsel "Select entity")
  4.   obj    (vlax-ename->vla-object (car e_list))
  5.   )
  6.  (vla-getboundingbox obj 'minExt 'maxExt)
  7.  (setq
  8.   mi_pnt   (vlax-safearray->list minExt)
  9.   ma_pnt   (vlax-safearray->list maxExt)
  10.   b_points (list mi_pnt ma_pnt)
  11.   )
  12.  )

At the prompt select the rectangular extrusion object.
The result is: ((28.952 11.0577 0.0) (35.8243 14.4762 0.846105))

Now, do a SUBTRACTION of the circular threaded object from the rectangular one.
Run the code again and select the rectangular object again.

Then the result is:
((28.952 11.0577 -1.11022e-16) (35.8243 14.4762 0.870144))
Nothing should have changed but the Z values for the second point on the bounding box are different, 0.846105 and 0.870144.
Is there an explanation for that?
Comments will be highly appreciated.


didier

  • Newt
  • Posts: 48
  • expatrié
Re: Changing BoundingBox mystery
« Reply #1 on: March 08, 2024, 11:26:47 AM »
Bonjour

I think it is because in the first choice (before subtraction) it is the part without the screw that is questioned.
but after subtracting, the screw point is embedded in the solid.
this point has a slightly different Z value.

I see nothing unusual in this information.

Amicalement
eternal beginner ...
my english is not fluent ...

LogicTools

  • Newt
  • Posts: 36
Re: Changing BoundingBox mystery
« Reply #2 on: March 08, 2024, 11:46:46 AM »
Merci didier,
But the Z value for the bounding box of the rectangular solid should not be affected by the subtraction.

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2140
  • class keyThumper<T>:ILazy<T>
Re: Changing BoundingBox mystery
« Reply #3 on: March 08, 2024, 03:33:15 PM »

@didier
It's best not to use blue text for posts because it's unreadable on the dark forum style that some of us use.

Regards,
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

didier

  • Newt
  • Posts: 48
  • expatrié
Re: Changing BoundingBox mystery
« Reply #4 on: March 09, 2024, 04:07:53 AM »
@logictools :
Of course, it is! It is the whole box that is concerned.
Test by modifying the screw...

@kdub_nz
Sorry, I did not know, I will not do it again, I didn’t even know that there were themes on "the swamp"

Amicalement
eternal beginner ...
my english is not fluent ...

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2140
  • class keyThumper<T>:ILazy<T>
Re: Changing BoundingBox mystery
« Reply #5 on: March 09, 2024, 04:34:18 AM »
All cool  :-)

Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8719
  • AKA Daniel
Re: Changing BoundingBox mystery
« Reply #6 on: March 09, 2024, 04:58:33 AM »
need a dark theme for the code windows

LogicTools

  • Newt
  • Posts: 36
Re: Changing BoundingBox mystery
« Reply #7 on: March 09, 2024, 08:38:40 AM »
Quote
Of course, it is! It is the whole box that is concerned.
Test by modifying the screw...
Merci didier,
Can you show me how to modify the screw keeping the same thread values and do the test to get the same Z before and after?
I would really appreciate that.