Package rope.mesh
Class R_Line2D
java.lang.Object
rope.core.Rope
rope.core.BigBang
rope.core.R_Graphic
rope.mesh.R_Line2D
- All Implemented Interfaces:
R_Constants
,R_Constants_Colour
- Direct Known Subclasses:
R_Puppet2D
-
Field Summary
Fields inherited from interface rope.core.R_Constants
ARC, BEGIN, BEZIER_VERTEX, BLANK, BOTTOM, BOX, BREAK, CARTESIAN, CENTER, CHAOS, CHOICE, CHORD, CIRCULAR, CLOSE, CLOUD, CORNER, CORNERS, COS, CROSS, CROSS_BOX_2, CROSS_BOX_3, CROSS_RECT, CUBE_LINE, CURVE_VERTEX, DECAGON, DIAGONAL, DIAMETER, DODECAGON, DOWN, DRAW, DXF, DYNAMIC, EAST, ELLIPSE, END, EQUATION, EULER, FIRST, FIT, FLOWER, FLUID, FX2D, G, GOLD_ANGLE, GOLD_NUMBER, GRAVITY, HALF, HALF_PI, HENDECAGON, HEPTAGON, HEXAGON, HORIZONTAL, HOUSE, HPI, ICOSI_DODECAHEDRON_LINE, IMAGE, JAVA2D, LANDSCAPE, LAST, LEAF, LEFT, LINE, LINEAR, MAD, MAGNETIC, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MIX, NEXT, NONAGON, NONE, NORMAL, NORTH, NORTH_EAST, NORTH_WEST, NOTCH, NOTHING, NULL, OCTOGON, OCTOHEDRON_LINE, OPEN, ORDER, P2D, P3D, PDF, PENTAGON, PERLIN, PHI, PI, PIE, PIXEL, POINT, POLAR, POLYGON, PORTRAIT, POW, PREVIOUS, QPI, QUADRATIC_VERTEX, QUARTER_PI, RADIUS, RAND, RECT, REPEAT, RHOMBIC_COSI_DODECAHEDRON_SMALL_LINE, RIGHT, ROOT, ROOT2, RUN, SCALE, SEED, SHAPE, SIDE, SIN, SKY, SOUTH, SOUTH_EAST, SOUTH_WEST, SPAN, SPHERE, SPHERE_HIGH, SPHERE_LOW, SPHERE_MEDIUM, SPIRAL, SQUARE, STAR, STAR_3D, START, STATIC, STOP, SVG, TAN, TAU, TETRAHEDRON, TETRAHEDRON_LINE, TEXT, TOP, TREE, TRIANGLE, TWO_PI, UP, VERSION, VERTEX, VERTICAL, VIRUS, WALK, WEST
Fields inherited from interface rope.core.R_Constants_Colour
ABRICOT, ABYSSE, ACAJOU, ALPHA, AMARANTE, AMBRE, ANSI_BLACK, ANSI_BLACK_BACKGROUND, ANSI_BLUE, ANSI_BLUE_BACKGROUND, ANSI_CYAN, ANSI_CYAN_BACKGROUND, ANSI_GREEN, ANSI_GREEN_BACKGROUND, ANSI_PURPLE, ANSI_PURPLE_BACKGROUND, ANSI_RED, ANSI_RED_BACKGROUND, ANSI_RESET, ANSI_WHITE, ANSI_WHITE_BACKGROUND, ANSI_YELLOW, ANSI_YELLOW_BACKGROUND, ARGB, ARGENT, AUBERGINE, AZUR, BIS, BISTRE, BLACK, BLANC, BLEU, BLOND, BLOOD, BLUE, BOUTEILLE, BRIGHTNESS, BRIQUE, BRONZE, BROWN, CACHOU, CAERULEUM, CAFE, CANARD, CANELLE, CAPUCINE, CARMIN, CARMINE, CAROTTE, CELESTE, CERISE, CHAMOIS, CHARTREUSE, CHOCOLAT, CIEL, CITROUILLE, COBALT, COFFEE, COLOMBIN, CORAIL, CYAN, ELEPHANT, EVEQUE, FRANCE, FUSCHIA, GOLD, GRADIENT, GRADIENT_BRIGHTNESS, GRADIENT_HUE, GRADIENT_SATURATION, GRAY, GRAY_MEDIUM, GREEN, GRENAT, GRIS, GRIS_MOYEN, GUEULES, HSB, HUE, IMPERIAL, JAUNE, LAPIS_LAZULI, LAVANDE, LILAS, LIME, LIN, LUNE, MAGENTA, MANDARINE, MARRON, MAUVE, MIMOSA, MOON, MOUNTBATTEN, NANKIN, NAPLE, NOIR, NOISETTE, NUIT, OCRE, OCRE_JAUNE, OCRE_ROUGE, OLIVE, OR, ORANGE, OUTREMER, PALETTE, PAYNE, PERLE, PERROQUET, PINK, PISTACHE, POURPRE, PRUNE, PURPLE, RAINBOW, RED, RGB, RGBA, ROSE, ROUGE, SANG, SAPIN, SATURATION, SAUGE, SEPIA, SHAKUDOU, SILVER, SINOPLE, SMALT, SOURIS, SPECTRUM, TAUPE, TENEBRE, TILLEUL, TURQUOISE, VERMILLON, VERT, VERT_D_EAU, VERT_DE_GRIS, VESSIE, VIOLET, WHITE, YELLOW, ZINZOLIN
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiona()
void
a
(float x, float y) use for temporary changevoid
use for temporary changefloat
angle()
Return the angle of the line from "a" to "b"float
b()
void
b
(float x, float y) use for temporary changevoid
use for temporary changechange
(float begin, float end) the idea is pass a normal value 0 to 1, where 1 is the size of your segment.copy()
float
dist()
Return the length of the lineget_field
(float direction, float start_angle, float end_angle, float dist) Can be useful to create a field action from the line. this function is use internally for the pixel growth.int
R_Pix[]
R_Pix[]
get_point
(float normal_abscissa) projected point on the line, the distance is calculated by multiplication the distance line by the normal argument where the starting point is the first point.get_point
(float normal_abscissa, float normal_ordinate) get_point
(int len_abscissa) get_point
(int len_abscissa, int len_ordinate) void
growth
(int level, int step) void
growth
(int level, int step, float direction, float fov) The direction is based on the bissector of the fovvoid
growth
(int level, int step, float direction, float start_fov, float end_fov) The direction is based on start_fov anglevoid
growth_option
(boolean field_is, int type) void
growth_option
(boolean field_is, int type, boolean use_gradient) The direction is based on start_fov angleid()
id
(int id) id
(int a, int b, int c, int d, int e, int f) id_a
(int id) id_b
(int id) id_c
(int id) id_d
(int id) id_e
(int id) id_f
(int id) intersection
(R_Line2D target) Return the intersection point between this line and an other one.intersection
(R_Line2D target, vec2... exception) Return the intersection point between this line and an other one.void
mode_abscissa
(int type) void
mode_abscissa
(int type, int level) void
mode_ordinate
(int type) void
mode_ordinate
(int type, int level) mute
(boolean is) change the state of the line, can be helpful to show or not the line and set behaviorboolean
mute_is()
Check if a vec point is on the line, if it's true return ne normal position on it '0' to '1' where '0' represent a and 'b' for '1'.offset
(float offset_x, float offset_y) make a displacement of the linereturn the projection of the point on the lineboolean
This function must be use with precaution because that's can break few function of the class like : offset(), change()... because the reference and the main point point on the same address So use in very specific cases.use with precaution because the vec who is returned pointer on real address in the memory so any modification can modify all value who ppoint on this onevoid
This function must be use with precaution because that's can break few function of the class like : offset(), change()... because the reference and the main point point on the same address So use in very specific cases.use with precaution because the vec who is returned pointer on real address in the memory so any modification can modify all value who ppoint on this onevoid
This function must be use with precaution because that's can break few function of the class like : offset(), change()... because the reference and the main point point on the same address So use in very specific cases.void
reset()
If you don't use show() function for any reason, and in parralelele you change point with function offset(), function change() or any futur method yo must use function reset() to come back to references points settingrotation
(float angle) Change the angle from the starting point "a"rotation
(float angle, float normal_pos) Create a rotation angle with the axe.set
(float ax, float ay, float bx, float by) use for definitive changementuse for definitive changementuse for definitive changementvoid
set_a
(float x, float y) use for definitive changementvoid
use for definitive changementvoid
set_b
(float x, float y) use for definitive changementvoid
use for definitive changementvoid
set_palette
(int... colours) void
set_pixels
(float density) void
set_pixels
(float density, float thickness) void
set_pixels
(float density, float thickness, R_Colour palette) void
show()
Show the result of all previous work on linevoid
void
show_pixels
(float density) void
show_pixels
(float density, float thickness) void
void
show_pixels_x2
(float density) void
show_pixels_x2
(float density, float thickness) toString()
Methods inherited from class rope.core.R_Graphic
arc, arc, arc, arc, aspect, aspect, background, background, background, background, background, background, beginContour, beginDraw, beginShape, beginShape, bezierVertex, bezierVertex, bezierVertex, bezierVertex, bezierVertex, bezierVertex, box, box, box, circle, circle, clear, colorMode, colorMode, colorMode, colorMode, colorMode, colorMode, colorMode, createGraphics, curveVertex, curveVertex, curveVertex, curveVertex, curveVertex, curveVertex, ellipse, ellipse, ellipse, ellipse, ellipseMode, ellipseMode, endContour, endDraw, endShape, endShape, fill, fill, fill, fill, fill, fill, fill_is, fill_is, get, get_renderer, get_renderer, image, image, image, image, image, line, line, line, line, loadPixels, loadShader, noFill, noStroke, pass_graphic, plot, plot, plot, plot, plot_x2, plot_x2, point, point, point, point, pop, popMatrix, push, pushMatrix, quadraticVertex, quadraticVertex, quadraticVertex, quadraticVertex, quadraticVertex, quadraticVertex, rect, rect, rect, rect, rect, rect, rectMode, rectMode, renderer_P2D, renderer_P3D, rotate, rotateX, rotateXY, rotateXYZ, rotateXZ, rotateY, rotateYZ, rotateZ, scale, scale, scale, set, set, set, shader, shearX, shearY, sphere, sphereDetail, sphereDetail, square, square, stroke, stroke, stroke, stroke, stroke, stroke, stroke_is, stroke_is, strokeWeight, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, textAlign, textAlign, textFont, textFont, textSize, thickness, translate, translate, translate, triangle, triangle, triangle, updatePixels, vertex, vertex, vertex, vertex, vertex, vertex, vertex, vertex, vertex, vertex, vertex, vertex, vertex, vertex, vertex, vertex
Methods inherited from class rope.core.BigBang
alpha, blue, brightness, color, color, color, color, createFont, createFont, createFont, getColorMode, getColorMode, green, hue, lerpColor, loadImage, longest_String, longest_String, longest_String_pixel, longest_String_pixel, longest_String_pixel, longest_String_pixel, longest_String_pixel, longest_String_pixel, noise, noiseSeed, pass_processing, pixel_density_is, pixel_density_is, red, saturation, save_BMP, save_frame, save_frame, save_frame, save_frame, sketchPath, sketchPath, start_PDF, start_PDF, start_PDF, width_char, width_char, width_char, width_String, width_String, width_String
Methods inherited from class rope.core.Rope
abs, abs, abs, abs, abs, abs, abs, abs, add, add, add, add, add, add, all, all, any, any, atan, barycenter, barycenter, barycenter, binary, binary, binary, binary, ceil, ceil, ceil, ceil, clamp, clamp, clamp, clamp, compare, compare, compare, compare, compare, compare, compare, compare, constrain, constrain, cos, cross, d_bell, d_cbrt, d_cos, d_normal, d_pow, d_sigmoid, d_sin, d_sqrt, dist, dist, dist, dist, dist, div, div, div, div, div, div, equal, equal, equal, equal, equal, equal, equal, equal, extension, extension_is, file_name, floor, floor, floor, floor, fract, fract, fract, fract, get_os, get_os_family, getColorMode, getColorMode, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, greaterThanEqual, hex, hex, hex, hex, in_line, in_line, in_polygon, in_polygon, in_polygon, in_polygon, in_segment, in_segment, index_pixel_array, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, lessThanEqual, map, map, map, map, max, max, max, max, max, max, max, max, min, min, min, min, min, min, min, min, mix, mix, mix, mix, mod, mod, mod, mod, mod, mod, mod, mult, mult, mult, mult, mult, mult, only, only, pow, print_array, print_err, print_err_tempo, print_out, print_tempo, projection, projection, projection, projection, projection, projection, projection, projection, random, random, random_next_gaussian, random_next_gaussian, random_next_gaussian, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, round, round, round, round, sign, sign, sign, sign, sign, sign, sign, sign, sin, smoothstep, smoothstep, smoothstep, smoothstep, split, split, sq, sqrt, step, step, step, step, sub, sub, sub, sub, sub, sub, to_cartesian_2D, to_cartesian_2D, to_cartesian_2D, to_cartesian_3D, to_cartesian_3D, to_cartesian_3D, truncate, truncate, unbinary, unhex
-
Constructor Details
-
R_Line2D
public R_Line2D(processing.core.PApplet pa) - Parameters:
pa
-
-
R_Line2D
- Parameters:
pa
-a
-b
-
-
R_Line2D
public R_Line2D(processing.core.PApplet pa, float ax, float ay, float bx, float by) - Parameters:
pa
-ax
-ay
-bx
-by
-
-
-
Method Details
-
set
use for definitive changement- Parameters:
a
-b
-
-
set
use for definitive changement- Parameters:
line
-- Returns:
-
set
use for definitive changement- Parameters:
ax
-ay
-bx
-by
-
-
set_a
public void set_a(float x, float y) use for definitive changement- Parameters:
x
-y
-
-
set_a
use for definitive changement- Parameters:
a
-
-
set_b
public void set_b(float x, float y) use for definitive changement- Parameters:
x
-y
-
-
set_b
use for definitive changement- Parameters:
b
-
-
a
- Returns:
- the final value for a
-
a
use for temporary change- Parameters:
a
-
-
a
public void a(float x, float y) use for temporary change- Parameters:
x
-y
-
-
b
- Returns:
- the final value for b
-
b
use for temporary change- Parameters:
b
-
-
b
public void b(float x, float y) use for temporary change- Parameters:
x
-y
-
-
pointer
This function must be use with precaution because that's can break few function of the class like : offset(), change()... because the reference and the main point point on the same address So use in very specific cases.- Parameters:
pointer_a
- give the same memory adress of the vec for the reference and the mane pointpointer_b
- give the same memory adress of the vec for the reference and the mane point- Returns:
-
pointer_a
use with precaution because the vec who is returned pointer on real address in the memory so any modification can modify all value who ppoint on this one- Returns:
- the final value for "a" and the original coord in the memory
-
pointer_a
This function must be use with precaution because that's can break few function of the class like : offset(), change()... because the reference and the main point point on the same address So use in very specific cases.- Parameters:
pointer_a
-
-
pointer_b
use with precaution because the vec who is returned pointer on real address in the memory so any modification can modify all value who ppoint on this one- Returns:
- the final value for "b" and the original coord in the memory
-
pointer_b
This function must be use with precaution because that's can break few function of the class like : offset(), change()... because the reference and the main point point on the same address So use in very specific cases.- Parameters:
pointer_b
-
-
offset
make a displacement of the line- Parameters:
offset
-- Returns:
-
offset
-
reset
public void reset()If you don't use show() function for any reason, and in parralelele you change point with function offset(), function change() or any futur method yo must use function reset() to come back to references points setting -
get_point
projected point on the line, the distance is calculated by multiplication the distance line by the normal argument where the starting point is the first point.- Parameters:
normal_abscissa
- where 0 is the starting point and 1 is the end point- Returns:
- a coordinate of the point
-
get_point
- Parameters:
normal_abscissa
-normal_ordinate
-- Returns:
-
get_point
- Parameters:
len_abscissa
- the position on the line can be upper or lower or the segment- Returns:
- a coordinate of the point
-
get_point
- Parameters:
len_abscissa
-len_ordinate
-- Returns:
-
angle
public float angle()Return the angle of the line from "a" to "b"- Returns:
-
angle
-
ortho
return the projection of the point on the line- Parameters:
p
- is point must projected on the line- Returns:
-
normal
Check if a vec point is on the line, if it's true return ne normal position on it '0' to '1' where '0' represent a and 'b' for '1'. if the point is not on the segment the value return NaN.- Parameters:
p
- coordinate of the point must be checkedmarge
- range in pixel around the point must be checked- Returns:
-
normal
- Parameters:
vec
-- Returns:
- See Also:
-
id
-
id
-
id
-
id_a
-
id_b
-
id_c
-
id_d
-
id_e
-
id_f
-
id
-
mute
change the state of the line, can be helpful to show or not the line and set behavior- Parameters:
is
-- Returns:
-
mute_is
public boolean mute_is() -
change
the idea is pass a normal value 0 to 1, where 1 is the size of your segment. The size is mult by the value- Parameters:
begin
- add the distance of the beginning of the segment, where the value is a normal value.end
- add the distance of the end of the segment, where the value is a normal value.
-
rotation
Change the angle from the starting point "a"- Parameters:
angle
-- Returns:
- himself
-
rotation
Create a rotation angle with the axe. The axe is calculated with a normal position where 0 is the start point and 1 the end point see point()- Parameters:
angle
- in radiannormal_pos
-- Returns:
- himself
-
mode_abscissa
public void mode_abscissa(int type) - Parameters:
type
- value to set the random on abscissa NORMAL, START, END, CENTER and SIDE is available
-
mode_abscissa
public void mode_abscissa(int type, int level) - Parameters:
type
- value to set the random on abscissa NORMAL, START, END, CENTER and SIDE is availablelevel
- from 1 to 13, but for CENTER and SIDE after 6 or 7 is not really interesting
-
mode_ordinate
public void mode_ordinate(int type) - Parameters:
type
- value to set the random on abscissa NORMAL, START, END, CENTER and SIDE is available
-
mode_ordinate
public void mode_ordinate(int type, int level) - Parameters:
type
- value to set the random on abscissa NORMAL, START, END, CENTER and SIDE is availablelevel
- from 1 to 13, but for CENTER and SIDE after 6 or 7 is not really interesting
-
set_pixels
public void set_pixels(float density) - Parameters:
density
- the ratio abscissa of pixels along the line from 0 to 1 usualy
-
set_pixels
public void set_pixels(float density, float thickness) - Parameters:
density
- the ratio abscissa of pixels along the line from 0 to 1thickness
- is the strokeWeight / ordinate of your line in pixel point
-
set_pixels
- Parameters:
density
- the ratio abscissa of pixels along the line from 0 to 1thickness
- is the strokeWeight / ordinate of your line in pixel pointcolour
- list of int color to create the pixel line
-
set_palette
public void set_palette(int... colours) -
growth_option
public void growth_option(boolean field_is, int type, boolean use_gradient) The direction is based on start_fov angle- Parameters:
type
- of pixel growth distributionuse_gradient
- to create a gradient from the fist color to second... il there more color in the palette the color is used like a pair colors successivelyuse_field
- to distribute the pixels only in the fov field
-
growth_option
public void growth_option(boolean field_is, int type) -
get_growth_type
public int get_growth_type() -
growth
public void growth(int level, int step) -
growth
public void growth(int level, int step, float direction, float fov) The direction is based on the bissector of the fov- Parameters:
level
- from 1 to nstep
- from 1 to ndirection
- from 0 to 2PI / TAUfov
- from 0 to 2PI / TAU
-
growth
public void growth(int level, int step, float direction, float start_fov, float end_fov) The direction is based on start_fov angle- Parameters:
level
- from 1 to nstep
- from 1 to ndirection
- from 0 to 2PI / TAUstart_fov
- from 0 to PIend_fov
- from 0 to PI
-
get_field
Can be useful to create a field action from the line. this function is use internally for the pixel growth.- Parameters:
direction
- of the fieldstart_angle
- from the point aend_angle
- from the point bdist
- distance of the field from the line- Returns:
- R_Shape
-
get_pixies
- Returns:
- the array of pixels a long the line if it's possible.
-
get_pixies_growth
-
pixels_is
public boolean pixels_is() -
show
public void show()Show the result of all previous work on line -
show_pixels
public void show_pixels() -
show_pixels_x2
public void show_pixels_x2() -
show_pixels
public void show_pixels(float density) -
show_pixels
public void show_pixels(float density, float thickness) - Parameters:
density
-thickness
-palette
-
-
show_pixels_x2
public void show_pixels_x2(float density) - Parameters:
density
-colour
-
-
show_pixels_x2
public void show_pixels_x2(float density, float thickness) - Parameters:
density
-thickness
-colour
-
-
barycenter
- Returns:
- the barycenter of the two points
-
dist
public float dist()Return the length of the line- Returns:
-
intersection
Return the intersection point between this line and an other one.- Parameters:
target
-- Returns:
-
intersection
Return the intersection point between this line and an other one.- Parameters:
target
-exception
- , list of vec2 point make an exception node, helpful when you don't want a specific node point- Returns:
-
copy
- Returns:
- copy of herself
-
toString
-