modify test
This commit is contained in:
parent
34ece3f720
commit
aa92b7cf68
2 changed files with 4 additions and 3 deletions
|
@ -43,6 +43,8 @@ func (c *CubicCurveFloat64) Subdivide() (c1, c2 *CubicCurveFloat64) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// subdivide the curve in straight lines using Casteljau subdivision
|
||||||
|
// and computing minimal distance tolerance
|
||||||
func (c *CubicCurveFloat64) SegmentCasteljau() []float64{
|
func (c *CubicCurveFloat64) SegmentCasteljau() []float64{
|
||||||
// reinit segments
|
// reinit segments
|
||||||
c.segments = make([]float64, 0, 2)
|
c.segments = make([]float64, 0, 2)
|
||||||
|
|
|
@ -7,11 +7,10 @@ import (
|
||||||
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
cf64Test1 = NewCubicCurveFloat64(100, 100, 200, 100, 100, 200, 200, 200)
|
||||||
cf64Test1 = NewCubicCurveFloat64(0, 0, 20000, 0, 0, 20000, 20000, 20000)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkCubicCurveCasteljauFloat64(b *testing.B) {
|
func BenchmarkCubicCurveCasteljauTest1(b *testing.B) {
|
||||||
var s []float64
|
var s []float64
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
s = cf64Test1.SegmentCasteljau()
|
s = cf64Test1.SegmentCasteljau()
|
||||||
|
|
Loading…
Reference in a new issue