Giter VIP home page Giter VIP logo

Comments (11)

revarbat avatar revarbat commented on August 21, 2024

That would be a bug, not a feature.

from bosl.

revarbat avatar revarbat commented on August 21, 2024

Actually, scalar cp in negative directional halves is arguably correct. It actually matches what the documentation states. But yes, the multiple translates are silly. I can remove two translates in each half function.

from bosl.

adrianVmariano avatar adrianVmariano commented on August 21, 2024

I know it matches the documentation. But it does not make intuitive sense to me. It took me a while to realize that the documentation described this unexpected behavior. So why do it like that?

from bosl.

revarbat avatar revarbat commented on August 21, 2024

It’s moving the cut plane in the vector direction of the halving.

from bosl.

revarbat avatar revarbat commented on August 21, 2024

All the *_half() modules share the same code with only a difference of the vector direction for the cut mask. Thus the scalar cp is defined in terms of that vector. If your getting the bottom_half(), the scalar cp is moving the cut plane away from the origin towards the bottom. It seemed fully consistent to me.

from bosl.

revarbat avatar revarbat commented on August 21, 2024

Another way to think of it is that a positive scalar cp always masks away more of the part being halved.

from bosl.

revarbat avatar revarbat commented on August 21, 2024

I could see an argument for inverting that, to make positive scalar cp make the part larger.

To be honest, having the scalar cp as just a shortcut for the coordinate cp didn’t even occur to me, as the scalar implied distance instead of position, and therefore the direction would be implied by the orientation of the cut.

from bosl.

adrianVmariano avatar adrianVmariano commented on August 21, 2024

I completely understand what you have done. I just find it unnatural, and unexpected (as indicated by the length of time I took me to figure it out...even after consulting the documentation, which is not unclear). I guess I just don't feel like there is an implied direction. I don't imagine this as a translation operation but as cutting at a designated position. To me it seems like

union() { top_half(cp=A) thing(); bottom_half(cp=A) thing() }

should be the whole thing(). I don't really understand the utility of the cp=[dummy1,dummy2,z] notation. I guess if you wanted to make a cube corner or something it would be handy, but mostly it seems like extra clutter. I think I probably would have done it as top_half(z=cut_location), right_half(x=location), left_half(x=location), etc.

from bosl.

revarbat avatar revarbat commented on August 21, 2024

I guess it's because, in my head, it's all generalized from the half_of() module, where cp is an arbitrary point on the not-necessarily axis oriented cut plane. I can see merit in the x, y, or z notation, though.

from bosl.

revarbat avatar revarbat commented on August 21, 2024

Added x, y, and z args to *_half() modules in BOSLv1 master branch commit 8c0f979

from bosl.

revarbat avatar revarbat commented on August 21, 2024

Implemented in BOSL2 master branch commit a6a2ed520bbd834a02005f7a803f74e3eda636a8

from bosl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.