Comments (8)
yes, we could implement the "r" versions of the magic methods, but i don't know if there would be any unwanted side-effects...
def __rmul__(self, factor):
...
from compas.
i agree, that is why never implemented the "r" versions. i think it is easy enough for the user to be explicit about their intent by writing the compas object first...
from compas.
Can it really be solved easily? I have the feeling it's not possible to define the binding of the star operator to take right hand operand as precedence...
from compas.
Ah true 👍
from compas.
yes, it's not a big issue. mathmatically the floating number is preferred in the front. like a = k b
, a, b are vectors.
from compas.
@tomvanmele you're right that rmul would address the issue, and @ZacZhangzhuo is right in that operators in Vectors should be complete -- but float * Vector
is quite counter intuitive?
from compas.
@tomvanmele I know I'm being frantic, but seems like this issue can be closed? The broader concept of vec ops isn't discussed.
from compas.
@tomvanmele you're right that rmul would address the issue, and @ZacZhangzhuo is right in that operators in Vectors should be complete -- but
float * Vector
is quite counter intuitive?
It is actually quite common and intuitive, especially when you compute a "WEIGHTED * long-expression"....
from compas.
Related Issues (20)
- PlanarSurface's parameters (xsize, ysize) don't work
- Color Error when the inputs are partly `int` HOT 4
- `docs\userguide\samples\quadmesh_planarize.py` needs to be fixed.
- URL's in README.md broken HOT 1
- Built-in support for units
- Intersection functions sometimes do not provide correct results with relative and absolute tolerance HOT 3
- Number typing in GH component HOT 1
- scipy >= 1.1 requirement - windows is able to install only through conda HOT 3
- Intersection methods that accepts tuples. HOT 1
- compas 2 installation error on Mac HOT 9
- code standards enforced by pre-commit hooks HOT 1
- Geometric Key still uses compas.PRECISION HOT 5
- where are the compas.geometry.trimesh* dependencies defined? HOT 15
- Independent Rhino Obj -> Compas Obj converter based on rhino3dm HOT 6
- Cannot convert from Rhino.Point to compas point using `point_to_compas` HOT 1
- Point float arithmetic not mutable?! HOT 2
- [Discussion] Type-consistent through basic math operation HOT 2
- Rhino scripts default install path is wrong for Rhino 8 HOT 5
- `Runtime error (NotSupportedException)` in Grasshopper when using `draw_labels` HOT 2
- RobotModel SceneObject with Python3 in Rhino8 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compas.