gogpc

package module
v0.0.0-...-4116d88 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2022 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

func CrossProd

func CrossProd(v1 []float64, v2 []float64, res []float64)

func GetNPoint

func GetNPoint(id int) []int

func GetTotalNPoint

func GetTotalNPoint(id int) int

func InnerProd

func InnerProd(p1 []float64, p2 []float64) (res float64)

func Mod

func Mod(p1 []float64) float64

func Normalize

func Normalize(coor []float64, new_coor []float64, trans_mat []float64)

func PolyDiff

func PolyDiff(p1, p2, res int)

func PolyInter

func PolyInter(p1, p2, res int)

func PolyUnion

func PolyUnion(p1, p2, res int)

func Unify

func Unify(v []float64) float64

Types

type Area

type Area struct {
	*Face
	*Poly
	// contains filtered or unexported fields
}

func InitArea

func InitArea() *Area

func (*Area) Normalize

func (a *Area) Normalize(ws []float64)

size of ws = 9 * 2 + tnp * 3

func (*Area) TransMap

func (a *Area) TransMap(trans_coor []float64) *Area

type AsyDrawer

type AsyDrawer struct {
	// contains filtered or unexported fields
}

func InitAsyDrawer

func InitAsyDrawer(fout_name string) *AsyDrawer

func (*AsyDrawer) Draw

func (d *AsyDrawer) Draw(p1, p2 []float64, class int)

type Bound

type Bound struct {
	// contains filtered or unexported fields
}

type Drawer

type Drawer interface {
	Draw(p1, p2 []float64, class int)
}

type Face

type Face struct {
	// contains filtered or unexported fields
}

func InitFace

func InitFace() *Face

type Point

type Point []float64

type Poly

type Poly struct {
	// contains filtered or unexported fields
}

func GetPoly

func GetPoly(id int) *Poly

func InitPoly

func InitPoly() *Poly

func (*Poly) CalBoundingBox

func (p *Poly) CalBoundingBox() (pmin, pmax []float64)

func (Poly) Draw

func (p Poly) Draw(d Drawer, class int)

func (*Poly) Finish

func (p *Poly) Finish()

func (*Poly) GetNPoint

func (p *Poly) GetNPoint() []int

func (*Poly) GetTotalNPoint

func (p *Poly) GetTotalNPoint() int

func (*Poly) IsEmpty

func (p *Poly) IsEmpty() bool

func (*Poly) NewBound

func (p *Poly) NewBound(is_hole bool)

func (*Poly) NewPoint

func (p *Poly) NewPoint(x, y float64)

func (*Poly) SetPoly

func (p *Poly) SetPoly(id int)

type Scene

type Scene struct {
	// contains filtered or unexported fields
}

func InitScene

func InitScene() *Scene

func ReadScene

func ReadScene(fout_name string) (s *Scene)

func (*Scene) CheckProjection

func (s *Scene) CheckProjection(proj_dir []float64, window *Area, is_debug bool) (res bool, shadow_scene *Scene)

func (*Scene) Draw

func (s *Scene) Draw(proj_coor []float64, d Drawer, draw_classes []int)

draw_classes [4]: 0: normal 1: hidden 2: checked 3: hidden and checked

func (*Scene) Finish

func (s *Scene) Finish(need_norm bool)

func (*Scene) GetTotalNPoint

func (s *Scene) GetTotalNPoint() (tnp, mnp int)

func (*Scene) NewArea

func (s *Scene) NewArea() *Area

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL