< GeeXLab Reference Guide />

> Back to Reference Guide Index


gh_polyline library

Description

gh_polyline is the module that manages polylines (a set of non-connected lines).


Number of functions: 14

  1. gh_polyline.create_v2 ()
  2. gh_polyline.get_vertex_color ()
  3. gh_polyline.get_vertex_position ()
  4. gh_polyline.set_vertex_color ()
  5. gh_polyline.set_vertex_draw_range ()
  6. gh_polyline.set_vertex_position ()
  7. gh_polyline.set_vertex_position_color ()
  8. gh_polyline.set_vertices_color ()
  9. gh_polyline.set_vertices_color_v2 ()
  10. gh_polyline.set_vertices_position ()
  11. gh_polyline.wideline_add_point ()
  12. gh_polyline.wideline_create ()
  13. gh_polyline.wideline_reset_points ()
  14. gh_polyline.wideline_set_line_width ()



create_v2

Description

Creates a polyline.


Syntax

pl_id = gh_polyline.create_v2(
 num_vertices,
 line_mode
)

Languages


Parameters


Return Values


Code sample


pl_id = gh_polyline.create_v2(num_vertices, line_mode)
			


get_vertex_color

Description

Gets the color of a particular vertex.


Syntax

r, g, b, a = gh_polyline.get_vertex_color(
 pl_id,
 vertex_index
)

Languages


Parameters


Return Values


Code sample


r, g, b, a = gh_polyline.get_vertex_color(pl_id, vertex_index)
			


get_vertex_position

Description

Gets the position of a particular vertex.


Syntax

x, y, z, w = gh_polyline.get_vertex_position(
 pl_id,
 vertex_index
)

Languages


Parameters


Return Values


Code sample


x, y, z, w = gh_polyline.get_vertex_position(pl_id, vertex_index)
			


set_vertex_color

Description

Sets the color of a particular vertex.


Syntax

gh_polyline.set_vertex_color(
 pl_id,
 vertex_index,
 r, g, b, a
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_polyline.set_vertex_color(pl_id, vertex_index, r, g, b, a)
			


set_vertex_draw_range

Description

Sets the start vertex index and the number of vertices to render.


Syntax

gh_polyline.set_vertex_draw_range(
 pl_id,
 start_index,
 num_vertices
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_polyline.set_vertex_draw_range(pl_id, 0, 2)
			


set_vertex_position

Description

Sets the position of a particular vertex.


Syntax

gh_polyline.set_vertex_position(
 pl_id,
 vertex_index,
 x, y, z, w
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_polyline.set_vertex_position(pl_id, vertex_index, x0, y0, z0, 1.0)
			


set_vertex_position_color

Description

Sets the position and the color of a particular vertex.


Syntax

gh_polyline.set_vertex_position_color(
 pl_id,
 vertex_index,
 x, y, z, w,
 r, g, b, a
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_polyline.set_vertex_position_color(pl_id, vertex_index, x, y, z, w, r, g, b, a)
			


set_vertices_color

Description

Sets the color of all vertices using a table as input


Syntax

gh_polyline.set_vertices_color(
 pl_id,
 start_offset,
 num_vertices,
 vertices_list
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


colors = {}
colors[1] = {x=1.0, y=1.0, z=0.0, w=1.0}
colors[2] = {x=0.0, y=1.0, z=1.0, w=1.0}

start_offset = 0
num_vertices = 2

gh_polyline.set_vertices_color(pl_id, start_offset, num_vertices, colors)
			


set_vertices_color_v2

Description

Sets the color of all vertices using a single RGBA value.


Syntax

gh_polyline.set_vertices_color_v2(
 pl_id,
 r, g, b, a
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_polyline.set_vertices_color_v2(pl_id, r, g, b, a)
			


set_vertices_position

Description

Sets the position of all vertices using a table as input


Syntax

gh_polyline.set_vertices_position(
 pl_id,
 start_offset,
 num_vertices,
 vertices_list
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


positions = {}
positions[1] = {x=-1.0, y=-1.0, z=0.0, w=1.0}
positions[2] = {x=1.0, y=1.0, z=0.0, w=1.0}

start_offset = 0
num_vertices = 2

gh_polyline.set_vertices_position(pl_id, start_offset, num_vertices, positions)
			


wideline_add_point

Description

Adds a point to a wideline.


Syntax

gh_polyline.wideline_add_point(
 pl_id,
 x, y, z, w,
 r, g, b, a
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_polyline.wideline_add_point(pl_id, x, y, z, w, r, g, b, a)
			


wideline_create

Description

Creates a wideline polyline.


Syntax

pl_id = gh_polyline.wideline_create(
 num_vertices,
 line_width
)

Languages


Parameters


Return Values


Code sample


pl_id = gh_polyline.wideline_create(num_vertices, 5.0)
			


wideline_reset_points

Description

Resets (clears) all points of a wideline.


Syntax

gh_polyline.wideline_reset_points(
 pl_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_polyline.wideline_reset_points(pl_id)
			


wideline_set_line_width

Description

Adds a point to a wideline.


Syntax

gh_polyline.wideline_set_line_width(
 pl_id,
 line_width
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_polyline.wideline_set_line_width(pl_id, line_width)
			






GeeXLab Rootard Guide | Downloads | Contact