Comments (7)
Looks like it's also missing in the CheatSheet. It's not in the release version, only dev snapshots have it.
Created #5084 as reminder for the documentation.
from openscad.
Use swizzling:
v = [1, 2, 3];
echo(v.xx); // ECHO: [1, 1]
echo(v.yyy); // ECHO: [2, 2, 2]
from openscad.
I'm struggling to find documentation on this feature (and in general, actually). It's been hard to search for things because WikiBook's search doesn't limit the scope to the user manual.
from openscad.
Reflecting, I don't think swizzling helps here. I'm not starting with an existing vector, I'm trying to create a new vector from a number literal. I could see this maybe being helpful if I had a set of numbers I was going to splat from, but I'd be limited to only vectors with a length of three, and so I'd have to create ceil(N / 3)
vectors.
from openscad.
Perhaps [val].xx and [val].xxx
from openscad.
echo([3].xxxx);
echo([for (n = [0,2,5,7,9]) [n].xxxx]);
The output limit for swizzling is 4 (inputs are xyzw
and rgba
).
from openscad.
Ahh, ok. I misread the docs on dot-access notation, and inferred that it wouldn't work on other-sized vectors.
This looks like it's sufficient to not need splat functions, thank you!
from openscad.
Related Issues (20)
- Union of closed shapes fails - ZIP file attached
- Union of closed shapes fails HOT 13
- Building on Mac OS X Using Homebrew Fails due to Qscintilla2 Versioning HOT 9
- Poor transparency calculation for previewing extruded hollow shapes with holes cut into them HOT 2
- Is this the right place to ask question about OpenSCAD HOT 4
- Chore: renovate python scripts to py>=3.8
- Display colors when rendering using F6 HOT 3
- Customizer: Support vectors with more than 4 elements HOT 1
- Nightly Build Crashes During Render of Complicated Object HOT 15
- Does not see user color schemes (Mac OS 13.6.4) HOT 2
- Intersection not working, creating union instead HOT 5
- preview does not show diffrence() correctly HOT 1
- roof_ss.cc sans me HOT 1
- `$variable` assignment no longer seems to work. HOT 13
- really weird issue that might involve floats HOT 1
- Linear_extrude with 3d vector as height yields inapropriate result HOT 3
- let color() work in rendering mode too and allow to export colored STL files. HOT 1
- Save and restore GUI window state more reliably
- Document vector swizzling HOT 1
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 openscad.