breaking(plugin-gore): Drop goreNumber
prop
Please use `gores` instead.
This commit is contained in:
parent
7f5a066dea
commit
1e5c55f65a
2 changed files with 10 additions and 16 deletions
|
@ -1,9 +1,5 @@
|
|||
import pkg from '../package.json'
|
||||
|
||||
const deprecated =
|
||||
"The 'goreNumber' property for the gore macro is deprecated " +
|
||||
"and will be removed in a future version. Please use 'gores' instead"
|
||||
|
||||
export default {
|
||||
name: pkg.name,
|
||||
version: pkg.version,
|
||||
|
@ -12,13 +8,11 @@ export default {
|
|||
},
|
||||
macros: {
|
||||
gore: function (so) {
|
||||
let from = so.from
|
||||
// TODO: Drop so.goreNumber in v3, it's deprecated
|
||||
let gores = so.gores || so.goreNumber //number of gores for the complete sphere
|
||||
if (so.goreNumber) console.log(deprecated)
|
||||
let radius = so.radius //radius of the sphere
|
||||
let prefix = so.prefix
|
||||
let extraLength = so.extraLength //the length of the straight section after a complete semisphere
|
||||
const from = so.from
|
||||
const gores = so.gores
|
||||
const radius = so.radius //radius of the sphere
|
||||
const prefix = so.prefix
|
||||
const extraLength = so.extraLength //the length of the straight section after a complete semisphere
|
||||
|
||||
this.points[prefix + 'p1'] = from.shift(0, (radius * Math.PI) / 2 + extraLength)
|
||||
this.points[prefix + 'Cp1'] = this.points[prefix + 'p1'].shift(
|
||||
|
|
|
@ -15,7 +15,7 @@ describe('Gore Plugin Tests', () => {
|
|||
macro('gore', {
|
||||
from:anchorPoint,
|
||||
radius:25,
|
||||
goreNumber:4,
|
||||
gores:4,
|
||||
extraLength:0,
|
||||
prefix:'gore'
|
||||
})
|
||||
|
@ -36,7 +36,7 @@ describe('Gore Plugin Tests', () => {
|
|||
macro('gore', {
|
||||
from:anchorPoint,
|
||||
radius:25,
|
||||
goreNumber:8,
|
||||
gores:8,
|
||||
extraLength:0,
|
||||
prefix:'gore'
|
||||
})
|
||||
|
@ -58,7 +58,7 @@ describe('Gore Plugin Tests', () => {
|
|||
macro('gore', {
|
||||
from:anchorPoint,
|
||||
radius:25,
|
||||
goreNumber:4,
|
||||
gores:4,
|
||||
extraLength:20,
|
||||
prefix:'gore'
|
||||
})
|
||||
|
@ -80,7 +80,7 @@ describe('Gore Plugin Tests', () => {
|
|||
macro('gore', {
|
||||
from:anchorPoint,
|
||||
radius:30,
|
||||
goreNumber:4,
|
||||
gores:4,
|
||||
extraLength:0,
|
||||
prefix:'gore'
|
||||
})
|
||||
|
@ -102,7 +102,7 @@ describe('Gore Plugin Tests', () => {
|
|||
macro('gore', {
|
||||
from:anchorPoint,
|
||||
radius:25,
|
||||
goreNumber:4,
|
||||
gores:4,
|
||||
extraLength:0,
|
||||
prefix:'gore'
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue