Example #1
0
func Curves(basis string, spans []int,
	wrap string, varargs ...interface{}) {
	pBasis := C.CString(basis)
	defer C.free(unsafe.Pointer(pBasis))
	pWrap := C.CString(wrap)
	defer C.free(unsafe.Pointer(pWrap))
	names, values, ownership := unzipArgs(varargs...)
	defer freeArgs(names, ownership)
	nArgs := C.RtInt(len(varargs) / 2)
	nSpans := C.RtInt(len(spans))
	pSpans := (*C.RtInt)(C.RtPointer(&spans[0]))
	pNames, pVals := safeArgs(names, values)
	C.RiCurvesV(pBasis, nSpans, pSpans,
		pWrap, nArgs, pNames, pVals)
}
Example #2
0
func Surface(name string, varargs ...interface{}) {
	pName := C.CString(name)
	defer C.free(unsafe.Pointer(pName))
	names, values, ownership := unzipArgs(varargs...)
	defer freeArgs(names, ownership)
	nArgs := C.RtInt(len(varargs) / 2)
	pNames, pVals := safeArgs(names, values)
	C.RiSurfaceV(pName, nArgs, pNames, pVals)
}
Example #3
0
func Disk(height float32, radius float32, tmax float32, varargs ...interface{}) {
	h := C.RtFloat(height)
	r := C.RtFloat(radius)
	t := C.RtFloat(tmax)
	names, values, ownership := unzipArgs(varargs...)
	defer freeArgs(names, ownership)
	nArgs := C.RtInt(len(varargs) / 2)
	pNames, pVals := safeArgs(names, values)
	C.RiDiskV(h, r, t, nArgs, pNames, pVals)
}
Example #4
0
func Cylinder(radius float32, zmin float32, zmax float32,
	ϴmax float32, varargs ...interface{}) {
	r := C.RtFloat(radius)
	z0 := C.RtFloat(zmin)
	z1 := C.RtFloat(zmax)
	t := C.RtFloat(ϴmax)
	names, values, ownership := unzipArgs(varargs...)
	defer freeArgs(names, ownership)
	nArgs := C.RtInt(len(varargs) / 2)
	pNames, pVals := safeArgs(names, values)
	C.RiCylinderV(r, z0, z1, t, nArgs, pNames, pVals)
}
Example #5
0
func Display(name string, dtype string, mode string, varargs ...interface{}) {
	pName := C.CString(name)
	defer C.free(unsafe.Pointer(pName))
	pDtype := C.CString(dtype)
	defer C.free(unsafe.Pointer(pDtype))
	pMode := C.CString(mode)
	defer C.free(unsafe.Pointer(pMode))
	names, values, ownership := unzipArgs(varargs...)
	defer freeArgs(names, ownership)
	nArgs := C.RtInt(len(varargs) / 2)
	pNames, pVals := safeArgs(names, values)
	C.RiDisplayV(pName, pDtype, pMode, nArgs, pNames, pVals)
}
Example #6
0
func Torus(majrad float32, minrad float32,
	phimin float32, phimax float32,
	tmax float32, varargs ...interface{}) {
	a := C.RtFloat(majrad)
	i := C.RtFloat(minrad)
	p := C.RtFloat(phimin)
	x := C.RtFloat(phimax)
	t := C.RtFloat(tmax)
	names, values, ownership := unzipArgs(varargs...)
	defer freeArgs(names, ownership)
	nArgs := C.RtInt(len(varargs) / 2)
	pNames, pVals := safeArgs(names, values)
	C.RiTorusV(a, i, p, x, t, nArgs, pNames, pVals)
}
Example #7
0
func Format(width int32, height int32, aspectRatio float32) {
	w := C.RtInt(width)
	h := C.RtInt(height)
	r := C.RtFloat(aspectRatio)
	C.RiFormat(w, h, r)
}