Skip to content

Commit

Permalink
Merge taataa/release-alpha23
Browse files Browse the repository at this point in the history
Release alpha23
  • Loading branch information
axelpale authored Dec 22, 2023
2 parents c4c370b + 617ec5c commit 62a5644
Show file tree
Hide file tree
Showing 16 changed files with 53 additions and 12 deletions.
1 change: 1 addition & 0 deletions docs/api/v2/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ yamdog.generate({
'dist3': affineplaneDocs + '#affineplanedist3',
'helm2': affineplaneDocs + '#affineplanehelm2',
'helm3': affineplaneDocs + '#affineplanehelm3',
'orient2': affineplaneDocs + '#affineplaneorient2',
'path2': affineplaneDocs + '#affineplanepath2',
'path3': affineplaneDocs + '#affineplanepath3',
'plane2': affineplaneDocs + '#affineplaneplane2',
Expand Down
12 changes: 6 additions & 6 deletions docs/api/v2/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a name="top"></a>
# Tapspace API Documentation v2.0.0-alpha.22
# Tapspace API Documentation v2.0.0-alpha.23


Choose version: [v1](https://taataa.github.io/tapspace/api/)[v2](#)
Expand Down Expand Up @@ -1414,7 +1414,7 @@ Create an [Orientation](#tapspacegeometryorientation) on this basis.
<p style="margin-bottom: 0"><strong>Parameters:</strong></p>

- *angle*
- a number or orient2 object { a, b }
- a number or [orient2](https://axelpale.github.io/affineplane/docs/API.html#affineplaneorient2) object { a, b }


<p style="margin-bottom: 0"><strong>Returns:</strong></p>
Expand Down Expand Up @@ -7565,7 +7565,7 @@ space and therefore they need conversion when transited between bases.
- *basis*
- a [Component](#tapspacecomponentscomponent)
- *orient*
- a orient2, or {a,b} relative to the basis.
- an [orient2](https://axelpale.github.io/affineplane/docs/API.html#affineplaneorient2) relative to the basis.



Expand Down Expand Up @@ -7612,7 +7612,7 @@ Source: [changeBasis.js](https://github.com/taataa/tapspace/blob/master/lib/geom
<a name="tapspacegeometryorientationgetraw"></a>
## [tapspace](#tapspace).[geometry](#tapspacegeometry).[Orientation](#tapspacegeometryorientation):[getRaw](#tapspacegeometryorientationgetraw)()

**Returns:** plain orient2 object `{a,b}` without basis data.
**Returns:** plain [orient2](https://axelpale.github.io/affineplane/docs/API.html#affineplaneorient2) object `{a,b}` without basis data.

Source: [getRaw.js](https://github.com/taataa/tapspace/blob/master/lib/geometry/Orientation/getRaw.js)

Expand All @@ -7637,7 +7637,7 @@ Unlike changeBasis, returns a plain object without basis data.

<p style="margin-bottom: 0"><strong>Returns:</strong></p>

- a orient2, complex number
- an [orient2](https://axelpale.github.io/affineplane/docs/API.html#affineplaneorient2)


Source: [transitRaw.js](https://github.com/taataa/tapspace/blob/master/lib/geometry/Orientation/transitRaw.js)
Expand All @@ -7657,7 +7657,7 @@ See [Point:transitRawOuter](#tapspacegeometrypointtransitrawouter) for details.

<p style="margin-bottom: 0"><strong>Returns:</strong></p>

- a orient2, complex number
- an [orient2](https://axelpale.github.io/affineplane/docs/API.html#affineplaneorient2)


Source: [transitRawOuter.js](https://github.com/taataa/tapspace/blob/master/lib/geometry/Orientation/transitRawOuter.js)
Expand Down
5 changes: 5 additions & 0 deletions lib/components/Hyperspace/rotateBy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ module.exports = function (radians, pivot) {
// this, for chaining
//

// Detect invalid radians: NaN, string
if (typeof radians !== 'number' || isNaN(radians)) {
throw new Error('Invalid rotation angle: ' + radians)
}

// Normalize the origin.
if (pivot.transitRaw) {
pivot = pivot.transitRaw(this)
Expand Down
5 changes: 5 additions & 0 deletions lib/components/Hyperspace/scaleBy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ module.exports = function (multiplier, pivot) {
// this, for chaining
//

// Detect invalid multiplier: NaN, string, zero
if (!multiplier || typeof multiplier !== 'number') {
throw new Error('Invalid scale multiplier: ' + multiplier)
}

// Normalize the origin.
if (pivot.transitRaw) {
pivot = pivot.transitRaw(this)
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Node/getBoundingBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function (orientation) {
let orient
if (orientation.getOrientation) {
// Is Component or Basis
orient = orientation.getOrientation.transitRaw(this)
orient = orientation.getOrientation().transitRaw(this)
} else {
// Is Orientation or errors
orient = orientation.transitRaw(this)
Expand Down
5 changes: 5 additions & 0 deletions lib/components/Transformer/rotateBy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ module.exports = function (radians, pivot) {
// this, for chaining
//

// Detect invalid radians: NaN, string
if (typeof radians !== 'number' || isNaN(radians)) {
throw new Error('Invalid rotation angle: ' + radians)
}

// Normalize the anchor point.
const anchor = this.atAnchor(pivot)

Expand Down
5 changes: 5 additions & 0 deletions lib/components/Transformer/scaleBy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ module.exports = function (multiplier, pivot) {
// this, for chaining
//

// Detect invalid multiplier: NaN, string, zero
if (!multiplier || typeof multiplier !== 'number') {
throw new Error('Invalid scale multiplier: ' + multiplier)
}

// Normalize the anchor point.
pivot = this.atAnchor(pivot)

Expand Down
5 changes: 5 additions & 0 deletions lib/geometry/Basis/rotateBy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ module.exports = function (radians, origin) {
// a Basis, the rotated basis
//

// Detect invalid radians: NaN, string
if (typeof radians !== 'number' || isNaN(radians)) {
throw new Error('Invalid rotation angle: ' + radians)
}

// Normalize
if (!origin) {
origin = { x: this.tran.x, y: this.tran.y, z: this.tran.z }
Expand Down
5 changes: 5 additions & 0 deletions lib/geometry/Basis/scaleBy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ module.exports = function (multiplier, origin) {
// a Basis, the scaled basis
//

// Detect invalid multiplier: NaN, string, zero
if (!multiplier || typeof multiplier !== 'number') {
throw new Error('Invalid scale multiplier: ' + multiplier)
}

// Normalize
if (!origin) {
origin = { x: this.tran.x, y: this.tran.y, z: this.tran.z }
Expand Down
5 changes: 5 additions & 0 deletions lib/geometry/Box/rotateBy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ module.exports = function (radians, origin) {
// a Box, the rotated box
//

// Detect invalid radians: NaN, string
if (typeof radians !== 'number' || isNaN(radians)) {
throw new Error('Invalid rotation angle: ' + radians)
}

// Normalize
if (origin.transitRaw) {
origin = origin.transitRaw(this.basis)
Expand Down
5 changes: 5 additions & 0 deletions lib/geometry/Box/scaleBy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ module.exports = function (multiplier, origin) {
// a Box, the scaled box
//

// Detect invalid multiplier: NaN, string, zero
if (!multiplier || typeof multiplier !== 'number') {
throw new Error('Invalid scale multiplier: ' + multiplier)
}

// The origin needs to be transited into outer basis of the box
// for the affineplane scaleBy to work.
// The outer basis of the box is the inner basis of Box... x_x
Expand Down
2 changes: 1 addition & 1 deletion lib/geometry/Orientation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Orientation = function (basis, orient) {
// basis
// a Component
// orient
// a orient2, or {a,b} relative to the basis.
// an orient2 relative to the basis.
//

// DEBUG
Expand Down
2 changes: 1 addition & 1 deletion lib/geometry/Orientation/transitRaw.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = function (newBasis) {
// a Component
//
// Return
// a orient2, complex number
// an orient2
//
const tran = this.basis.getTransitionTo(newBasis)
return orient2.transitFrom(this.orient, tran)
Expand Down
2 changes: 1 addition & 1 deletion lib/geometry/Orientation/transitRawOuter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = function (basis) {
// a Component
//
// Return
// a orient2, complex number
// an orient2
//
const tran = this.basis.getTransitionToParentOf(basis)
return orient2.transitFrom(this.orient, tran)
Expand Down
2 changes: 1 addition & 1 deletion lib/version.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tapspace",
"version": "2.0.0-alpha.22",
"version": "2.0.0-alpha.23",
"description": "A zoomable user interface lib for web apps",
"keywords": [
"zoomable",
Expand Down

0 comments on commit 62a5644

Please sign in to comment.