mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-22 22:35:18 +02:00
add doc
This commit is contained in:
@@ -398,6 +398,12 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
|
|||||||
[**util/binary_search**(sorted, target[, lo, hi])](https://openhome.cc/eGossip/OpenSCAD/lib3x-binary_search.html) | search a value in a sorted list.
|
[**util/binary_search**(sorted, target[, lo, hi])](https://openhome.cc/eGossip/OpenSCAD/lib3x-binary_search.html) | search a value in a sorted list.
|
||||||
[**util/count**(lt, test)](https://openhome.cc/eGossip/OpenSCAD/lib3x-count.html) | return the number of times `test` return `true` in the list.
|
[**util/count**(lt, test)](https://openhome.cc/eGossip/OpenSCAD/lib3x-count.html) | return the number of times `test` return `true` in the list.
|
||||||
|
|
||||||
|
## Matrix
|
||||||
|
|
||||||
|
Signature | Description
|
||||||
|
--|--
|
||||||
|
[**matrix/m_replace**(m, i, j, value)](https://openhome.cc/eGossip/OpenSCAD/lib3x-m_replace.html) | replace the aᵢⱼ element of a matrix.
|
||||||
|
|
||||||
## Point Picking
|
## Point Picking
|
||||||
|
|
||||||
Signature | Description
|
Signature | Description
|
||||||
|
32
docs/lib3x-m_replace.md
Normal file
32
docs/lib3x-m_replace.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# m_replace
|
||||||
|
|
||||||
|
It replaces the aᵢⱼ element of a matrix.
|
||||||
|
|
||||||
|
**Since:** 3.3
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
- `m` : A matrix.
|
||||||
|
- `i` : The i-th row.
|
||||||
|
- `j` : The j-th column.
|
||||||
|
- `value` : The new value.
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
use <matrix/m_replace.scad>
|
||||||
|
|
||||||
|
original_m = [
|
||||||
|
[1, 2, 3, 4],
|
||||||
|
[5, 6, 7, 8],
|
||||||
|
[9, 10, 11, 12]
|
||||||
|
];
|
||||||
|
|
||||||
|
expected = [
|
||||||
|
[1, 2, 3, 4],
|
||||||
|
[5, 6, 70, 8],
|
||||||
|
[9, 10, 11, 12]
|
||||||
|
];
|
||||||
|
|
||||||
|
actual = m_replace(original_m, 1, 2, 70);
|
||||||
|
|
||||||
|
assert(actual == expected);
|
Reference in New Issue
Block a user