k3d package

Submodules

k3d.helpers module

Utilities module.

k3d.helpers.array_serialization_wrap(name)[source]
k3d.helpers.array_to_binary(ar, compression_level=0, force_contiguous=True)[source]

Pre-process numpy array for serialization in traittypes.Array.

k3d.helpers.bounding_corners(bounds, z_bounds=0.0, 1)[source]

Return corner point coordinates for bounds array.

k3d.helpers.callback_serialization_wrap(name)[source]
k3d.helpers.check_attribute_range(attribute, color_range=()) → Tuple[float, float][source]

Provide color range versus provided attribute, compute color range if necessary.

If the attribute is empty or color_range has 2 elements, returns color_range unchanged. Computes color range as [min(attribute), max(attribute)]. When min(attribute) == max(attribute) returns [min(attribute), min(attribute)+1].

k3d.helpers.download(url)str[source]

Retrieve the file at url, save it locally and return the path.

k3d.helpers.from_json(input, obj=None)[source]
k3d.helpers.from_json_to_array(value, obj=None)[source]

Post-process traittypes.Array after deserialization to numpy array.

k3d.helpers.get_bounding_box(model_matrix, boundary=[- 1, 1, - 1, 1, - 1, 1])[source]
k3d.helpers.get_bounding_box_point(position)[source]
k3d.helpers.get_bounding_box_points(arr, model_matrix)[source]
k3d.helpers.map_colors(attribute, color_map, color_range=()) → Sequence[int][source]
k3d.helpers.min_bounding_dimension(bounds)[source]

Return a minimal dimension along axis in a bounds ([min_x, max_x, min_y, max_y, min_z, max_z]) array.

k3d.helpers.minmax(iterable)[source]

Return [min(iterable), max(iterable)].

This should be a built in function in Python, and has even been proposed on Python-ideas newsgroup. This is not to be confused with the algorithm for finding winning strategies in 2-player games.

k3d.helpers.quad(w, h)[source]
k3d.helpers.shape_validation(*dimensions)[source]

Create a validator callback (for Array traittype) ensuring shape.

k3d.helpers.to_json(name, input, obj=None, compression_level=0)[source]
k3d.helpers.validate_sparse_voxels(trait, value)[source]

Check sparse voxels for array shape and values.

k3d.factory module

k3d.factory.label(text, position=0, 0, 0, color=255, on_top=True, size=1.0, name=None, max_length=0.8, mode='dynamic', is_html=False, label_box=True, compression_level=0)[source]

Create a Text drawable for 3D-positioned text labels.

Arguments:
text: str.

Content of the text.

position: list.

Coordinates (x, y, z) of the text’s position.

on_top: Boolean.

Render order with 3d object

label_box: Boolean.

Label background box.

color: int.

Packed RGB color of the text (0xff0000 is red, 0xff is blue).

max_length: float.

Maximum length of line in % of half screen size (only for mode=’dynamic’).

mode: str.

Label node. Can be ‘dynamic’, ‘local’ or ‘side’.

name: string.

A name of a object

is_html: Boolean.

Whether text should be interpreted as HTML insted of KaTeX.

size: float.

Font size in ‘em’ HTML units.

k3d.factory.line(vertices, color=255, colors=[], attribute=[], color_map=[0.0, 0.001462, 0.000466, 0.013866, 0.00392156862745098, 0.002267, 0.00127, 0.01857, 0.00784313725490196, 0.003299, 0.002249, 0.024239, 0.011764705882352941, 0.004547, 0.003392, 0.030909, 0.01568627450980392, 0.006006, 0.004692, 0.038558, 0.0196078431372549, 0.007676, 0.006136, 0.046836, 0.023529411764705882, 0.009561, 0.007713, 0.055143, 0.027450980392156862, 0.011663, 0.009417, 0.06346, 0.03137254901960784, 0.013995, 0.011225, 0.071862, 0.03529411764705882, 0.016561, 0.013136, 0.080282, 0.0392156862745098, 0.019373, 0.015133, 0.088767, 0.043137254901960784, 0.022447, 0.017199, 0.097327, 0.047058823529411764, 0.025793, 0.019331, 0.10593, 0.050980392156862744, 0.029432, 0.021503, 0.114621, 0.054901960784313725, 0.033385, 0.023702, 0.123397, 0.058823529411764705, 0.037668, 0.025921, 0.132232, 0.06274509803921569, 0.042253, 0.028139, 0.141141, 0.06666666666666667, 0.046915, 0.030324, 0.150164, 0.07058823529411765, 0.051644, 0.032474, 0.159254, 0.07450980392156863, 0.056449, 0.034569, 0.168414, 0.0784313725490196, 0.06134, 0.03659, 0.177642, 0.08235294117647059, 0.066331, 0.038504, 0.186962, 0.08627450980392157, 0.071429, 0.040294, 0.196354, 0.09019607843137255, 0.076637, 0.041905, 0.205799, 0.09411764705882353, 0.081962, 0.043328, 0.215289, 0.09803921568627451, 0.087411, 0.044556, 0.224813, 0.10196078431372549, 0.09299, 0.045583, 0.234358, 0.10588235294117647, 0.098702, 0.046402, 0.243904, 0.10980392156862745, 0.104551, 0.047008, 0.25343, 0.11372549019607843, 0.110536, 0.047399, 0.262912, 0.11764705882352941, 0.116656, 0.047574, 0.272321, 0.12156862745098039, 0.122908, 0.047536, 0.281624, 0.12549019607843137, 0.129285, 0.047293, 0.290788, 0.12941176470588234, 0.135778, 0.046856, 0.299776, 0.13333333333333333, 0.142378, 0.046242, 0.308553, 0.13725490196078433, 0.149073, 0.045468, 0.317085, 0.1411764705882353, 0.15585, 0.044559, 0.325338, 0.14509803921568626, 0.162689, 0.043554, 0.333277, 0.14901960784313725, 0.169575, 0.042489, 0.340874, 0.15294117647058825, 0.176493, 0.041402, 0.348111, 0.1568627450980392, 0.183429, 0.040329, 0.354971, 0.16078431372549018, 0.190367, 0.039309, 0.361447, 0.16470588235294117, 0.197297, 0.0384, 0.367535, 0.16862745098039217, 0.204209, 0.037632, 0.373238, 0.17254901960784313, 0.211095, 0.03703, 0.378563, 0.1764705882352941, 0.217949, 0.036615, 0.383522, 0.1803921568627451, 0.224763, 0.036405, 0.388129, 0.1843137254901961, 0.231538, 0.036405, 0.3924, 0.18823529411764706, 0.238273, 0.036621, 0.396353, 0.19215686274509802, 0.244967, 0.037055, 0.400007, 0.19607843137254902, 0.25162, 0.037705, 0.403378, 0.2, 0.258234, 0.038571, 0.406485, 0.20392156862745098, 0.26481, 0.039647, 0.409345, 0.20784313725490194, 0.271347, 0.040922, 0.411976, 0.21176470588235294, 0.27785, 0.042353, 0.414392, 0.21568627450980393, 0.284321, 0.043933, 0.416608, 0.2196078431372549, 0.290763, 0.045644, 0.418637, 0.22352941176470587, 0.297178, 0.04747, 0.420491, 0.22745098039215686, 0.303568, 0.049396, 0.422182, 0.23137254901960785, 0.309935, 0.051407, 0.423721, 0.23529411764705882, 0.316282, 0.05349, 0.425116, 0.2392156862745098, 0.32261, 0.055634, 0.426377, 0.24313725490196078, 0.328921, 0.057827, 0.427511, 0.24705882352941178, 0.335217, 0.06006, 0.428524, 0.25098039215686274, 0.3415, 0.062325, 0.429425, 0.2549019607843137, 0.347771, 0.064616, 0.430217, 0.2588235294117647, 0.354032, 0.066925, 0.430906, 0.2627450980392157, 0.360284, 0.069247, 0.431497, 0.26666666666666666, 0.366529, 0.071579, 0.431994, 0.27058823529411763, 0.372768, 0.073915, 0.4324, 0.27450980392156865, 0.379001, 0.076253, 0.432719, 0.2784313725490196, 0.385228, 0.078591, 0.432955, 0.2823529411764706, 0.391453, 0.080927, 0.433109, 0.28627450980392155, 0.397674, 0.083257, 0.433183, 0.2901960784313725, 0.403894, 0.08558, 0.433179, 0.29411764705882354, 0.410113, 0.087896, 0.433098, 0.2980392156862745, 0.416331, 0.090203, 0.432943, 0.30196078431372547, 0.422549, 0.092501, 0.432714, 0.3058823529411765, 0.428768, 0.09479, 0.432412, 0.30980392156862746, 0.434987, 0.097069, 0.432039, 0.3137254901960784, 0.441207, 0.099338, 0.431594, 0.3176470588235294, 0.447428, 0.101597, 0.43108, 0.32156862745098036, 0.453651, 0.103848, 0.430498, 0.3254901960784314, 0.459875, 0.106089, 0.429846, 0.32941176470588235, 0.4661, 0.108322, 0.429125, 0.3333333333333333, 0.472328, 0.110547, 0.428334, 0.33725490196078434, 0.478558, 0.112764, 0.427475, 0.3411764705882353, 0.484789, 0.114974, 0.426548, 0.34509803921568627, 0.491022, 0.117179, 0.425552, 0.34901960784313724, 0.497257, 0.119379, 0.424488, 0.3529411764705882, 0.503493, 0.121575, 0.423356, 0.3568627450980392, 0.50973, 0.123769, 0.422156, 0.3607843137254902, 0.515967, 0.12596, 0.420887, 0.36470588235294116, 0.522206, 0.12815, 0.419549, 0.3686274509803922, 0.528444, 0.130341, 0.418142, 0.37254901960784315, 0.534683, 0.132534, 0.416667, 0.3764705882352941, 0.54092, 0.134729, 0.415123, 0.3803921568627451, 0.547157, 0.136929, 0.413511, 0.38431372549019605, 0.553392, 0.139134, 0.411829, 0.38823529411764707, 0.559624, 0.141346, 0.410078, 0.39215686274509803, 0.565854, 0.143567, 0.408258, 0.396078431372549, 0.572081, 0.145797, 0.406369, 0.4, 0.578304, 0.148039, 0.404411, 0.403921568627451, 0.584521, 0.150294, 0.402385, 0.40784313725490196, 0.590734, 0.152563, 0.40029, 0.4117647058823529, 0.59694, 0.154848, 0.398125, 0.4156862745098039, 0.603139, 0.157151, 0.395891, 0.4196078431372549, 0.60933, 0.159474, 0.393589, 0.4235294117647059, 0.615513, 0.161817, 0.391219, 0.42745098039215684, 0.621685, 0.164184, 0.388781, 0.43137254901960786, 0.627847, 0.166575, 0.386276, 0.43529411764705883, 0.633998, 0.168992, 0.383704, 0.4392156862745098, 0.640135, 0.171438, 0.381065, 0.44313725490196076, 0.64626, 0.173914, 0.378359, 0.44705882352941173, 0.652369, 0.176421, 0.375586, 0.45098039215686275, 0.658463, 0.178962, 0.372748, 0.4549019607843137, 0.66454, 0.181539, 0.369846, 0.4588235294117647, 0.670599, 0.184153, 0.366879, 0.4627450980392157, 0.676638, 0.186807, 0.363849, 0.4666666666666667, 0.682656, 0.189501, 0.360757, 0.47058823529411764, 0.688653, 0.192239, 0.357603, 0.4745098039215686, 0.694627, 0.195021, 0.354388, 0.4784313725490196, 0.700576, 0.197851, 0.351113, 0.4823529411764706, 0.7065, 0.200728, 0.347777, 0.48627450980392156, 0.712396, 0.203656, 0.344383, 0.49019607843137253, 0.718264, 0.206636, 0.340931, 0.49411764705882355, 0.724103, 0.20967, 0.337424, 0.4980392156862745, 0.729909, 0.212759, 0.333861, 0.5019607843137255, 0.735683, 0.215906, 0.330245, 0.5058823529411764, 0.741423, 0.219112, 0.326576, 0.5098039215686274, 0.747127, 0.222378, 0.322856, 0.5137254901960784, 0.752794, 0.225706, 0.319085, 0.5176470588235293, 0.758422, 0.229097, 0.315266, 0.5215686274509804, 0.76401, 0.232554, 0.311399, 0.5254901960784314, 0.769556, 0.236077, 0.307485, 0.5294117647058824, 0.775059, 0.239667, 0.303526, 0.5333333333333333, 0.780517, 0.243327, 0.299523, 0.5372549019607843, 0.785929, 0.247056, 0.295477, 0.5411764705882353, 0.791293, 0.250856, 0.29139, 0.5450980392156862, 0.796607, 0.254728, 0.287264, 0.5490196078431373, 0.801871, 0.258674, 0.283099, 0.5529411764705883, 0.807082, 0.262692, 0.278898, 0.5568627450980392, 0.812239, 0.266786, 0.274661, 0.5607843137254902, 0.817341, 0.270954, 0.27039, 0.5647058823529412, 0.822386, 0.275197, 0.266085, 0.5686274509803921, 0.827372, 0.279517, 0.26175, 0.5725490196078431, 0.832299, 0.283913, 0.257383, 0.5764705882352941, 0.837165, 0.288385, 0.252988, 0.580392156862745, 0.841969, 0.292933, 0.248564, 0.5843137254901961, 0.846709, 0.297559, 0.244113, 0.5882352941176471, 0.851384, 0.30226, 0.239636, 0.592156862745098, 0.855992, 0.307038, 0.235133, 0.596078431372549, 0.860533, 0.311892, 0.230606, 0.6, 0.865006, 0.316822, 0.226055, 0.6039215686274509, 0.869409, 0.321827, 0.221482, 0.6078431372549019, 0.873741, 0.326906, 0.216886, 0.611764705882353, 0.878001, 0.33206, 0.212268, 0.615686274509804, 0.882188, 0.337287, 0.207628, 0.6196078431372549, 0.886302, 0.342586, 0.202968, 0.6235294117647059, 0.890341, 0.347957, 0.198286, 0.6274509803921569, 0.894305, 0.353399, 0.193584, 0.6313725490196078, 0.898192, 0.358911, 0.18886, 0.6352941176470588, 0.902003, 0.364492, 0.184116, 0.6392156862745098, 0.905735, 0.37014, 0.17935, 0.6431372549019607, 0.90939, 0.375856, 0.174563, 0.6470588235294118, 0.912966, 0.381636, 0.169755, 0.6509803921568628, 0.916462, 0.387481, 0.164924, 0.6549019607843137, 0.919879, 0.393389, 0.16007, 0.6588235294117647, 0.923215, 0.399359, 0.155193, 0.6627450980392157, 0.92647, 0.405389, 0.150292, 0.6666666666666666, 0.929644, 0.411479, 0.145367, 0.6705882352941176, 0.932737, 0.417627, 0.140417, 0.6745098039215687, 0.935747, 0.423831, 0.13544, 0.6784313725490196, 0.938675, 0.430091, 0.130438, 0.6823529411764706, 0.941521, 0.436405, 0.125409, 0.6862745098039216, 0.944285, 0.442772, 0.120354, 0.6901960784313725, 0.946965, 0.449191, 0.115272, 0.6941176470588235, 0.949562, 0.45566, 0.110164, 0.6980392156862745, 0.952075, 0.462178, 0.105031, 0.7019607843137254, 0.954506, 0.468744, 0.099874, 0.7058823529411764, 0.956852, 0.475356, 0.094695, 0.7098039215686275, 0.959114, 0.482014, 0.089499, 0.7137254901960784, 0.961293, 0.488716, 0.084289, 0.7176470588235294, 0.963387, 0.495462, 0.079073, 0.7215686274509804, 0.965397, 0.502249, 0.073859, 0.7254901960784313, 0.967322, 0.509078, 0.068659, 0.7294117647058823, 0.969163, 0.515946, 0.063488, 0.7333333333333333, 0.970919, 0.522853, 0.058367, 0.7372549019607844, 0.97259, 0.529798, 0.053324, 0.7411764705882353, 0.974176, 0.53678, 0.048392, 0.7450980392156863, 0.975677, 0.543798, 0.043618, 0.7490196078431373, 0.977092, 0.55085, 0.03905, 0.7529411764705882, 0.978422, 0.557937, 0.034931, 0.7568627450980392, 0.979666, 0.565057, 0.031409, 0.7607843137254902, 0.980824, 0.572209, 0.028508, 0.7647058823529411, 0.981895, 0.579392, 0.02625, 0.7686274509803921, 0.982881, 0.586606, 0.024661, 0.7725490196078432, 0.983779, 0.593849, 0.02377, 0.7764705882352941, 0.984591, 0.601122, 0.023606, 0.7803921568627451, 0.985315, 0.608422, 0.024202, 0.7843137254901961, 0.985952, 0.61575, 0.025592, 0.788235294117647, 0.986502, 0.623105, 0.027814, 0.792156862745098, 0.986964, 0.630485, 0.030908, 0.796078431372549, 0.987337, 0.63789, 0.034916, 0.8, 0.987622, 0.64532, 0.039886, 0.803921568627451, 0.987819, 0.652773, 0.045581, 0.807843137254902, 0.987926, 0.66025, 0.05175, 0.8117647058823529, 0.987945, 0.667748, 0.058329, 0.8156862745098039, 0.987874, 0.675267, 0.065257, 0.8196078431372549, 0.987714, 0.682807, 0.072489, 0.8235294117647058, 0.987464, 0.690366, 0.07999, 0.8274509803921568, 0.987124, 0.697944, 0.087731, 0.8313725490196078, 0.986694, 0.70554, 0.095694, 0.8352941176470589, 0.986175, 0.713153, 0.103863, 0.8392156862745098, 0.985566, 0.720782, 0.112229, 0.8431372549019608, 0.984865, 0.728427, 0.120785, 0.8470588235294118, 0.984075, 0.736087, 0.129527, 0.8509803921568627, 0.983196, 0.743758, 0.138453, 0.8549019607843137, 0.982228, 0.751442, 0.147565, 0.8588235294117647, 0.981173, 0.759135, 0.156863, 0.8627450980392157, 0.980032, 0.766837, 0.166353, 0.8666666666666667, 0.978806, 0.774545, 0.176037, 0.8705882352941177, 0.977497, 0.782258, 0.185923, 0.8745098039215686, 0.976108, 0.789974, 0.196018, 0.8784313725490196, 0.974638, 0.797692, 0.206332, 0.8823529411764706, 0.973088, 0.805409, 0.216877, 0.8862745098039215, 0.971468, 0.813122, 0.227658, 0.8901960784313725, 0.969783, 0.820825, 0.238686, 0.8941176470588235, 0.968041, 0.828515, 0.249972, 0.8980392156862745, 0.966243, 0.836191, 0.261534, 0.9019607843137255, 0.964394, 0.843848, 0.273391, 0.9058823529411765, 0.962517, 0.851476, 0.285546, 0.9098039215686274, 0.960626, 0.859069, 0.29801, 0.9137254901960784, 0.95872, 0.866624, 0.31082, 0.9176470588235294, 0.956834, 0.874129, 0.323974, 0.9215686274509803, 0.954997, 0.881569, 0.337475, 0.9254901960784314, 0.953215, 0.888942, 0.351369, 0.9294117647058824, 0.951546, 0.896226, 0.365627, 0.9333333333333333, 0.950018, 0.903409, 0.380271, 0.9372549019607843, 0.948683, 0.910473, 0.395289, 0.9411764705882353, 0.947594, 0.917399, 0.410665, 0.9450980392156862, 0.946809, 0.924168, 0.426373, 0.9490196078431372, 0.946392, 0.930761, 0.442367, 0.9529411764705882, 0.946403, 0.937159, 0.458592, 0.9568627450980391, 0.946903, 0.943348, 0.47497, 0.9607843137254902, 0.947937, 0.949318, 0.491426, 0.9647058823529412, 0.949545, 0.955063, 0.50786, 0.9686274509803922, 0.95174, 0.960587, 0.524203, 0.9725490196078431, 0.954529, 0.965896, 0.540361, 0.9764705882352941, 0.957896, 0.971003, 0.556275, 0.9803921568627451, 0.961812, 0.975924, 0.571925, 0.984313725490196, 0.966249, 0.980678, 0.587206, 0.9882352941176471, 0.971162, 0.985282, 0.602154, 0.9921568627450981, 0.976511, 0.989753, 0.61676, 0.996078431372549, 0.982257, 0.994109, 0.631017, 1.0, 0.988362, 0.998364, 0.644924], color_range=[], width=0.01, shader='thick', radial_segments=8, name=None, compression_level=0, **kwargs)[source]

Create a Line drawable for plotting segments and polylines.

Arguments:
vertices: array_like.

Array with (x, y, z) coordinates of segment endpoints.

color: int.

Packed RGB color of the lines (0xff0000 is red, 0xff is blue) when colors is empty.

colors: array_like.

Array of int: packed RGB colors (0xff0000 is red, 0xff is blue) when attribute, color_map and color_range are empty.

attribute: array_like.

Array of float attribute for the color mapping, coresponding to each vertex.

color_map: list.

A list of float quadruplets (attribute value, R, G, B), sorted by attribute value. The first quadruplet should have value 0.0, the last 1.0; R, G, B are RGB color components in the range 0.0 to 1.0.

color_range: list.

A pair [min_value, max_value], which determines the levels of color attribute mapped to 0 and 1 in the color map respectively.

shader: str.

Display style (name of the shader used) of the lines. Legal values are:

simple

simple lines,

thick

thick lines,

mesh

high precision triangle mesh of segments (high quality and GPU load).

radial_segments: ‘int’.

Number of segmented faces around the circumference of the tube

width: float.

Thickness of the lines.

name: string.

A name of a object

kwargs: dict.

Dictionary arguments to configure transform and model_matrix.

k3d.factory.marching_cubes(scalar_field, level, color=255, wireframe=False, flat_shading=True, opacity=1.0, spacings_x=[], spacings_y=[], spacings_z=[], name=None, compression_level=0, **kwargs)[source]

Create a MarchingCubes drawable.

Plot an isosurface of a scalar field obtained through a Marching Cubes algorithm.

The default domain of the scalar field is -0.5 < x, y, z < 0.5.

If the domain should be different, the bounding box needs to be transformed using kwargs, like this:

marching_cubes(…, bounds=[-1, 1, -1, 1, -1, 1])

or:

marching_cubes(…, xmin=-10, xmax=10, ymin=-4, ymax=4, zmin=0, zmax=20)

or:

marching_cubes(…, scaling=[width, height, length])

Arguments:
scalar_field: array_like.

A 3D scalar field of values.

level: float.

Value at the computed isosurface.

color: int.

Packed RGB color of the isosurface (0xff0000 is red, 0xff is blue).

wireframe: bool.

Whether mesh should display as wireframe.

spacings_x: array_like.

A spacings in x axis. Should match to scalar_field shape.

spacings_y: array_like.

A spacings in y axis. Should match to scalar_field shape.

spacings_z: array_like.

A spacings in z axis. Should match to scalar_field shape.

flat_shading: bool.

Whether mesh should display with flat shading.

opacity: float.

Opacity of mesh.

name: string.

A name of a object

kwargs: dict.

Dictionary arguments to configure transform and model_matrix.

k3d.factory.mesh(vertices, indices, color=255, colors=[], attribute=[], color_map=[0.0, 0.001462, 0.000466, 0.013866, 0.00392156862745098, 0.002267, 0.00127, 0.01857, 0.00784313725490196, 0.003299, 0.002249, 0.024239, 0.011764705882352941, 0.004547, 0.003392, 0.030909, 0.01568627450980392, 0.006006, 0.004692, 0.038558, 0.0196078431372549, 0.007676, 0.006136, 0.046836, 0.023529411764705882, 0.009561, 0.007713, 0.055143, 0.027450980392156862, 0.011663, 0.009417, 0.06346, 0.03137254901960784, 0.013995, 0.011225, 0.071862, 0.03529411764705882, 0.016561, 0.013136, 0.080282, 0.0392156862745098, 0.019373, 0.015133, 0.088767, 0.043137254901960784, 0.022447, 0.017199, 0.097327, 0.047058823529411764, 0.025793, 0.019331, 0.10593, 0.050980392156862744, 0.029432, 0.021503, 0.114621, 0.054901960784313725, 0.033385, 0.023702, 0.123397, 0.058823529411764705, 0.037668, 0.025921, 0.132232, 0.06274509803921569, 0.042253, 0.028139, 0.141141, 0.06666666666666667, 0.046915, 0.030324, 0.150164, 0.07058823529411765, 0.051644, 0.032474, 0.159254, 0.07450980392156863, 0.056449, 0.034569, 0.168414, 0.0784313725490196, 0.06134, 0.03659, 0.177642, 0.08235294117647059, 0.066331, 0.038504, 0.186962, 0.08627450980392157, 0.071429, 0.040294, 0.196354, 0.09019607843137255, 0.076637, 0.041905, 0.205799, 0.09411764705882353, 0.081962, 0.043328, 0.215289, 0.09803921568627451, 0.087411, 0.044556, 0.224813, 0.10196078431372549, 0.09299, 0.045583, 0.234358, 0.10588235294117647, 0.098702, 0.046402, 0.243904, 0.10980392156862745, 0.104551, 0.047008, 0.25343, 0.11372549019607843, 0.110536, 0.047399, 0.262912, 0.11764705882352941, 0.116656, 0.047574, 0.272321, 0.12156862745098039, 0.122908, 0.047536, 0.281624, 0.12549019607843137, 0.129285, 0.047293, 0.290788, 0.12941176470588234, 0.135778, 0.046856, 0.299776, 0.13333333333333333, 0.142378, 0.046242, 0.308553, 0.13725490196078433, 0.149073, 0.045468, 0.317085, 0.1411764705882353, 0.15585, 0.044559, 0.325338, 0.14509803921568626, 0.162689, 0.043554, 0.333277, 0.14901960784313725, 0.169575, 0.042489, 0.340874, 0.15294117647058825, 0.176493, 0.041402, 0.348111, 0.1568627450980392, 0.183429, 0.040329, 0.354971, 0.16078431372549018, 0.190367, 0.039309, 0.361447, 0.16470588235294117, 0.197297, 0.0384, 0.367535, 0.16862745098039217, 0.204209, 0.037632, 0.373238, 0.17254901960784313, 0.211095, 0.03703, 0.378563, 0.1764705882352941, 0.217949, 0.036615, 0.383522, 0.1803921568627451, 0.224763, 0.036405, 0.388129, 0.1843137254901961, 0.231538, 0.036405, 0.3924, 0.18823529411764706, 0.238273, 0.036621, 0.396353, 0.19215686274509802, 0.244967, 0.037055, 0.400007, 0.19607843137254902, 0.25162, 0.037705, 0.403378, 0.2, 0.258234, 0.038571, 0.406485, 0.20392156862745098, 0.26481, 0.039647, 0.409345, 0.20784313725490194, 0.271347, 0.040922, 0.411976, 0.21176470588235294, 0.27785, 0.042353, 0.414392, 0.21568627450980393, 0.284321, 0.043933, 0.416608, 0.2196078431372549, 0.290763, 0.045644, 0.418637, 0.22352941176470587, 0.297178, 0.04747, 0.420491, 0.22745098039215686, 0.303568, 0.049396, 0.422182, 0.23137254901960785, 0.309935, 0.051407, 0.423721, 0.23529411764705882, 0.316282, 0.05349, 0.425116, 0.2392156862745098, 0.32261, 0.055634, 0.426377, 0.24313725490196078, 0.328921, 0.057827, 0.427511, 0.24705882352941178, 0.335217, 0.06006, 0.428524, 0.25098039215686274, 0.3415, 0.062325, 0.429425, 0.2549019607843137, 0.347771, 0.064616, 0.430217, 0.2588235294117647, 0.354032, 0.066925, 0.430906, 0.2627450980392157, 0.360284, 0.069247, 0.431497, 0.26666666666666666, 0.366529, 0.071579, 0.431994, 0.27058823529411763, 0.372768, 0.073915, 0.4324, 0.27450980392156865, 0.379001, 0.076253, 0.432719, 0.2784313725490196, 0.385228, 0.078591, 0.432955, 0.2823529411764706, 0.391453, 0.080927, 0.433109, 0.28627450980392155, 0.397674, 0.083257, 0.433183, 0.2901960784313725, 0.403894, 0.08558, 0.433179, 0.29411764705882354, 0.410113, 0.087896, 0.433098, 0.2980392156862745, 0.416331, 0.090203, 0.432943, 0.30196078431372547, 0.422549, 0.092501, 0.432714, 0.3058823529411765, 0.428768, 0.09479, 0.432412, 0.30980392156862746, 0.434987, 0.097069, 0.432039, 0.3137254901960784, 0.441207, 0.099338, 0.431594, 0.3176470588235294, 0.447428, 0.101597, 0.43108, 0.32156862745098036, 0.453651, 0.103848, 0.430498, 0.3254901960784314, 0.459875, 0.106089, 0.429846, 0.32941176470588235, 0.4661, 0.108322, 0.429125, 0.3333333333333333, 0.472328, 0.110547, 0.428334, 0.33725490196078434, 0.478558, 0.112764, 0.427475, 0.3411764705882353, 0.484789, 0.114974, 0.426548, 0.34509803921568627, 0.491022, 0.117179, 0.425552, 0.34901960784313724, 0.497257, 0.119379, 0.424488, 0.3529411764705882, 0.503493, 0.121575, 0.423356, 0.3568627450980392, 0.50973, 0.123769, 0.422156, 0.3607843137254902, 0.515967, 0.12596, 0.420887, 0.36470588235294116, 0.522206, 0.12815, 0.419549, 0.3686274509803922, 0.528444, 0.130341, 0.418142, 0.37254901960784315, 0.534683, 0.132534, 0.416667, 0.3764705882352941, 0.54092, 0.134729, 0.415123, 0.3803921568627451, 0.547157, 0.136929, 0.413511, 0.38431372549019605, 0.553392, 0.139134, 0.411829, 0.38823529411764707, 0.559624, 0.141346, 0.410078, 0.39215686274509803, 0.565854, 0.143567, 0.408258, 0.396078431372549, 0.572081, 0.145797, 0.406369, 0.4, 0.578304, 0.148039, 0.404411, 0.403921568627451, 0.584521, 0.150294, 0.402385, 0.40784313725490196, 0.590734, 0.152563, 0.40029, 0.4117647058823529, 0.59694, 0.154848, 0.398125, 0.4156862745098039, 0.603139, 0.157151, 0.395891, 0.4196078431372549, 0.60933, 0.159474, 0.393589, 0.4235294117647059, 0.615513, 0.161817, 0.391219, 0.42745098039215684, 0.621685, 0.164184, 0.388781, 0.43137254901960786, 0.627847, 0.166575, 0.386276, 0.43529411764705883, 0.633998, 0.168992, 0.383704, 0.4392156862745098, 0.640135, 0.171438, 0.381065, 0.44313725490196076, 0.64626, 0.173914, 0.378359, 0.44705882352941173, 0.652369, 0.176421, 0.375586, 0.45098039215686275, 0.658463, 0.178962, 0.372748, 0.4549019607843137, 0.66454, 0.181539, 0.369846, 0.4588235294117647, 0.670599, 0.184153, 0.366879, 0.4627450980392157, 0.676638, 0.186807, 0.363849, 0.4666666666666667, 0.682656, 0.189501, 0.360757, 0.47058823529411764, 0.688653, 0.192239, 0.357603, 0.4745098039215686, 0.694627, 0.195021, 0.354388, 0.4784313725490196, 0.700576, 0.197851, 0.351113, 0.4823529411764706, 0.7065, 0.200728, 0.347777, 0.48627450980392156, 0.712396, 0.203656, 0.344383, 0.49019607843137253, 0.718264, 0.206636, 0.340931, 0.49411764705882355, 0.724103, 0.20967, 0.337424, 0.4980392156862745, 0.729909, 0.212759, 0.333861, 0.5019607843137255, 0.735683, 0.215906, 0.330245, 0.5058823529411764, 0.741423, 0.219112, 0.326576, 0.5098039215686274, 0.747127, 0.222378, 0.322856, 0.5137254901960784, 0.752794, 0.225706, 0.319085, 0.5176470588235293, 0.758422, 0.229097, 0.315266, 0.5215686274509804, 0.76401, 0.232554, 0.311399, 0.5254901960784314, 0.769556, 0.236077, 0.307485, 0.5294117647058824, 0.775059, 0.239667, 0.303526, 0.5333333333333333, 0.780517, 0.243327, 0.299523, 0.5372549019607843, 0.785929, 0.247056, 0.295477, 0.5411764705882353, 0.791293, 0.250856, 0.29139, 0.5450980392156862, 0.796607, 0.254728, 0.287264, 0.5490196078431373, 0.801871, 0.258674, 0.283099, 0.5529411764705883, 0.807082, 0.262692, 0.278898, 0.5568627450980392, 0.812239, 0.266786, 0.274661, 0.5607843137254902, 0.817341, 0.270954, 0.27039, 0.5647058823529412, 0.822386, 0.275197, 0.266085, 0.5686274509803921, 0.827372, 0.279517, 0.26175, 0.5725490196078431, 0.832299, 0.283913, 0.257383, 0.5764705882352941, 0.837165, 0.288385, 0.252988, 0.580392156862745, 0.841969, 0.292933, 0.248564, 0.5843137254901961, 0.846709, 0.297559, 0.244113, 0.5882352941176471, 0.851384, 0.30226, 0.239636, 0.592156862745098, 0.855992, 0.307038, 0.235133, 0.596078431372549, 0.860533, 0.311892, 0.230606, 0.6, 0.865006, 0.316822, 0.226055, 0.6039215686274509, 0.869409, 0.321827, 0.221482, 0.6078431372549019, 0.873741, 0.326906, 0.216886, 0.611764705882353, 0.878001, 0.33206, 0.212268, 0.615686274509804, 0.882188, 0.337287, 0.207628, 0.6196078431372549, 0.886302, 0.342586, 0.202968, 0.6235294117647059, 0.890341, 0.347957, 0.198286, 0.6274509803921569, 0.894305, 0.353399, 0.193584, 0.6313725490196078, 0.898192, 0.358911, 0.18886, 0.6352941176470588, 0.902003, 0.364492, 0.184116, 0.6392156862745098, 0.905735, 0.37014, 0.17935, 0.6431372549019607, 0.90939, 0.375856, 0.174563, 0.6470588235294118, 0.912966, 0.381636, 0.169755, 0.6509803921568628, 0.916462, 0.387481, 0.164924, 0.6549019607843137, 0.919879, 0.393389, 0.16007, 0.6588235294117647, 0.923215, 0.399359, 0.155193, 0.6627450980392157, 0.92647, 0.405389, 0.150292, 0.6666666666666666, 0.929644, 0.411479, 0.145367, 0.6705882352941176, 0.932737, 0.417627, 0.140417, 0.6745098039215687, 0.935747, 0.423831, 0.13544, 0.6784313725490196, 0.938675, 0.430091, 0.130438, 0.6823529411764706, 0.941521, 0.436405, 0.125409, 0.6862745098039216, 0.944285, 0.442772, 0.120354, 0.6901960784313725, 0.946965, 0.449191, 0.115272, 0.6941176470588235, 0.949562, 0.45566, 0.110164, 0.6980392156862745, 0.952075, 0.462178, 0.105031, 0.7019607843137254, 0.954506, 0.468744, 0.099874, 0.7058823529411764, 0.956852, 0.475356, 0.094695, 0.7098039215686275, 0.959114, 0.482014, 0.089499, 0.7137254901960784, 0.961293, 0.488716, 0.084289, 0.7176470588235294, 0.963387, 0.495462, 0.079073, 0.7215686274509804, 0.965397, 0.502249, 0.073859, 0.7254901960784313, 0.967322, 0.509078, 0.068659, 0.7294117647058823, 0.969163, 0.515946, 0.063488, 0.7333333333333333, 0.970919, 0.522853, 0.058367, 0.7372549019607844, 0.97259, 0.529798, 0.053324, 0.7411764705882353, 0.974176, 0.53678, 0.048392, 0.7450980392156863, 0.975677, 0.543798, 0.043618, 0.7490196078431373, 0.977092, 0.55085, 0.03905, 0.7529411764705882, 0.978422, 0.557937, 0.034931, 0.7568627450980392, 0.979666, 0.565057, 0.031409, 0.7607843137254902, 0.980824, 0.572209, 0.028508, 0.7647058823529411, 0.981895, 0.579392, 0.02625, 0.7686274509803921, 0.982881, 0.586606, 0.024661, 0.7725490196078432, 0.983779, 0.593849, 0.02377, 0.7764705882352941, 0.984591, 0.601122, 0.023606, 0.7803921568627451, 0.985315, 0.608422, 0.024202, 0.7843137254901961, 0.985952, 0.61575, 0.025592, 0.788235294117647, 0.986502, 0.623105, 0.027814, 0.792156862745098, 0.986964, 0.630485, 0.030908, 0.796078431372549, 0.987337, 0.63789, 0.034916, 0.8, 0.987622, 0.64532, 0.039886, 0.803921568627451, 0.987819, 0.652773, 0.045581, 0.807843137254902, 0.987926, 0.66025, 0.05175, 0.8117647058823529, 0.987945, 0.667748, 0.058329, 0.8156862745098039, 0.987874, 0.675267, 0.065257, 0.8196078431372549, 0.987714, 0.682807, 0.072489, 0.8235294117647058, 0.987464, 0.690366, 0.07999, 0.8274509803921568, 0.987124, 0.697944, 0.087731, 0.8313725490196078, 0.986694, 0.70554, 0.095694, 0.8352941176470589, 0.986175, 0.713153, 0.103863, 0.8392156862745098, 0.985566, 0.720782, 0.112229, 0.8431372549019608, 0.984865, 0.728427, 0.120785, 0.8470588235294118, 0.984075, 0.736087, 0.129527, 0.8509803921568627, 0.983196, 0.743758, 0.138453, 0.8549019607843137, 0.982228, 0.751442, 0.147565, 0.8588235294117647, 0.981173, 0.759135, 0.156863, 0.8627450980392157, 0.980032, 0.766837, 0.166353, 0.8666666666666667, 0.978806, 0.774545, 0.176037, 0.8705882352941177, 0.977497, 0.782258, 0.185923, 0.8745098039215686, 0.976108, 0.789974, 0.196018, 0.8784313725490196, 0.974638, 0.797692, 0.206332, 0.8823529411764706, 0.973088, 0.805409, 0.216877, 0.8862745098039215, 0.971468, 0.813122, 0.227658, 0.8901960784313725, 0.969783, 0.820825, 0.238686, 0.8941176470588235, 0.968041, 0.828515, 0.249972, 0.8980392156862745, 0.966243, 0.836191, 0.261534, 0.9019607843137255, 0.964394, 0.843848, 0.273391, 0.9058823529411765, 0.962517, 0.851476, 0.285546, 0.9098039215686274, 0.960626, 0.859069, 0.29801, 0.9137254901960784, 0.95872, 0.866624, 0.31082, 0.9176470588235294, 0.956834, 0.874129, 0.323974, 0.9215686274509803, 0.954997, 0.881569, 0.337475, 0.9254901960784314, 0.953215, 0.888942, 0.351369, 0.9294117647058824, 0.951546, 0.896226, 0.365627, 0.9333333333333333, 0.950018, 0.903409, 0.380271, 0.9372549019607843, 0.948683, 0.910473, 0.395289, 0.9411764705882353, 0.947594, 0.917399, 0.410665, 0.9450980392156862, 0.946809, 0.924168, 0.426373, 0.9490196078431372, 0.946392, 0.930761, 0.442367, 0.9529411764705882, 0.946403, 0.937159, 0.458592, 0.9568627450980391, 0.946903, 0.943348, 0.47497, 0.9607843137254902, 0.947937, 0.949318, 0.491426, 0.9647058823529412, 0.949545, 0.955063, 0.50786, 0.9686274509803922, 0.95174, 0.960587, 0.524203, 0.9725490196078431, 0.954529, 0.965896, 0.540361, 0.9764705882352941, 0.957896, 0.971003, 0.556275, 0.9803921568627451, 0.961812, 0.975924, 0.571925, 0.984313725490196, 0.966249, 0.980678, 0.587206, 0.9882352941176471, 0.971162, 0.985282, 0.602154, 0.9921568627450981, 0.976511, 0.989753, 0.61676, 0.996078431372549, 0.982257, 0.994109, 0.631017, 1.0, 0.988362, 0.998364, 0.644924], color_range=[], wireframe=False, flat_shading=True, opacity=1.0, texture=None, texture_file_format=None, volume=[], volume_bounds=[], opacity_function=[], side='front', uvs=None, name=None, compression_level=0, triangles_attribute=[], **kwargs)[source]

Create a Mesh drawable representing a 3D triangles mesh.

Arguments:
vertices: array_like.

Array of triangle vertices: float (x, y, z) coordinate triplets.

indices: array_like.

Array of vertex indices: int triplets of indices from vertices array.

color: int.

Packed RGB color of the mesh (0xff0000 is red, 0xff is blue) when not using color maps.

colors: array_like.

Same-length array of int-packed RGB color of the points (0xff0000 is red, 0xff is blue).

attribute: array_like.

Array of float attribute for the color mapping, coresponding to each vertex.

triangles_attribute: array_like.

Array of float attribute for the color mapping, coresponding to each triangle.

color_map: list.

A list of float quadruplets (attribute value, R, G, B), sorted by attribute value. The first quadruplet should have value 0.0, the last 1.0; R, G, B are RGB color components in the range 0.0 to 1.0.

color_range: list.

A pair [min_value, max_value], which determines the levels of color attribute mapped to 0 and 1 in the color map respectively.

wireframe: bool.

Whether mesh should display as wireframe.

flat_shading: bool.

Whether mesh should display with flat shading.

opacity: float.

Opacity of mesh.

volume: array_like.

3D array of float

volume_bounds: array_like.

6-element tuple specifying the bounds of the volume data (x0, x1, y0, y1, z0, z1)

opacity_function: array.

A list of float tuples (attribute value, opacity), sorted by attribute value. The first typles should have value 0.0, the last 1.0; opacity is in the range 0.0 to 1.0.

side: string.

Control over which side to render for a mesh. Legal values are front, back, double.

name: string.

A name of a object

texture: bytes.

Image data in a specific format.

texture_file_format: str.

Format of the data, it should be the second part of MIME format of type ‘image/’, for example ‘jpeg’, ‘png’, ‘gif’, ‘tiff’.

uvs: array_like.

Array of float uvs for the texturing, coresponding to each vertex.

kwargs: dict.

Dictionary arguments to configure transform and model_matrix.

k3d.factory.mip(volume, color_map=[0.0, 0.001462, 0.000466, 0.013866, 0.00392156862745098, 0.002267, 0.00127, 0.01857, 0.00784313725490196, 0.003299, 0.002249, 0.024239, 0.011764705882352941, 0.004547, 0.003392, 0.030909, 0.01568627450980392, 0.006006, 0.004692, 0.038558, 0.0196078431372549, 0.007676, 0.006136, 0.046836, 0.023529411764705882, 0.009561, 0.007713, 0.055143, 0.027450980392156862, 0.011663, 0.009417, 0.06346, 0.03137254901960784, 0.013995, 0.011225, 0.071862, 0.03529411764705882, 0.016561, 0.013136, 0.080282, 0.0392156862745098, 0.019373, 0.015133, 0.088767, 0.043137254901960784, 0.022447, 0.017199, 0.097327, 0.047058823529411764, 0.025793, 0.019331, 0.10593, 0.050980392156862744, 0.029432, 0.021503, 0.114621, 0.054901960784313725, 0.033385, 0.023702, 0.123397, 0.058823529411764705, 0.037668, 0.025921, 0.132232, 0.06274509803921569, 0.042253, 0.028139, 0.141141, 0.06666666666666667, 0.046915, 0.030324, 0.150164, 0.07058823529411765, 0.051644, 0.032474, 0.159254, 0.07450980392156863, 0.056449, 0.034569, 0.168414, 0.0784313725490196, 0.06134, 0.03659, 0.177642, 0.08235294117647059, 0.066331, 0.038504, 0.186962, 0.08627450980392157, 0.071429, 0.040294, 0.196354, 0.09019607843137255, 0.076637, 0.041905, 0.205799, 0.09411764705882353, 0.081962, 0.043328, 0.215289, 0.09803921568627451, 0.087411, 0.044556, 0.224813, 0.10196078431372549, 0.09299, 0.045583, 0.234358, 0.10588235294117647, 0.098702, 0.046402, 0.243904, 0.10980392156862745, 0.104551, 0.047008, 0.25343, 0.11372549019607843, 0.110536, 0.047399, 0.262912, 0.11764705882352941, 0.116656, 0.047574, 0.272321, 0.12156862745098039, 0.122908, 0.047536, 0.281624, 0.12549019607843137, 0.129285, 0.047293, 0.290788, 0.12941176470588234, 0.135778, 0.046856, 0.299776, 0.13333333333333333, 0.142378, 0.046242, 0.308553, 0.13725490196078433, 0.149073, 0.045468, 0.317085, 0.1411764705882353, 0.15585, 0.044559, 0.325338, 0.14509803921568626, 0.162689, 0.043554, 0.333277, 0.14901960784313725, 0.169575, 0.042489, 0.340874, 0.15294117647058825, 0.176493, 0.041402, 0.348111, 0.1568627450980392, 0.183429, 0.040329, 0.354971, 0.16078431372549018, 0.190367, 0.039309, 0.361447, 0.16470588235294117, 0.197297, 0.0384, 0.367535, 0.16862745098039217, 0.204209, 0.037632, 0.373238, 0.17254901960784313, 0.211095, 0.03703, 0.378563, 0.1764705882352941, 0.217949, 0.036615, 0.383522, 0.1803921568627451, 0.224763, 0.036405, 0.388129, 0.1843137254901961, 0.231538, 0.036405, 0.3924, 0.18823529411764706, 0.238273, 0.036621, 0.396353, 0.19215686274509802, 0.244967, 0.037055, 0.400007, 0.19607843137254902, 0.25162, 0.037705, 0.403378, 0.2, 0.258234, 0.038571, 0.406485, 0.20392156862745098, 0.26481, 0.039647, 0.409345, 0.20784313725490194, 0.271347, 0.040922, 0.411976, 0.21176470588235294, 0.27785, 0.042353, 0.414392, 0.21568627450980393, 0.284321, 0.043933, 0.416608, 0.2196078431372549, 0.290763, 0.045644, 0.418637, 0.22352941176470587, 0.297178, 0.04747, 0.420491, 0.22745098039215686, 0.303568, 0.049396, 0.422182, 0.23137254901960785, 0.309935, 0.051407, 0.423721, 0.23529411764705882, 0.316282, 0.05349, 0.425116, 0.2392156862745098, 0.32261, 0.055634, 0.426377, 0.24313725490196078, 0.328921, 0.057827, 0.427511, 0.24705882352941178, 0.335217, 0.06006, 0.428524, 0.25098039215686274, 0.3415, 0.062325, 0.429425, 0.2549019607843137, 0.347771, 0.064616, 0.430217, 0.2588235294117647, 0.354032, 0.066925, 0.430906, 0.2627450980392157, 0.360284, 0.069247, 0.431497, 0.26666666666666666, 0.366529, 0.071579, 0.431994, 0.27058823529411763, 0.372768, 0.073915, 0.4324, 0.27450980392156865, 0.379001, 0.076253, 0.432719, 0.2784313725490196, 0.385228, 0.078591, 0.432955, 0.2823529411764706, 0.391453, 0.080927, 0.433109, 0.28627450980392155, 0.397674, 0.083257, 0.433183, 0.2901960784313725, 0.403894, 0.08558, 0.433179, 0.29411764705882354, 0.410113, 0.087896, 0.433098, 0.2980392156862745, 0.416331, 0.090203, 0.432943, 0.30196078431372547, 0.422549, 0.092501, 0.432714, 0.3058823529411765, 0.428768, 0.09479, 0.432412, 0.30980392156862746, 0.434987, 0.097069, 0.432039, 0.3137254901960784, 0.441207, 0.099338, 0.431594, 0.3176470588235294, 0.447428, 0.101597, 0.43108, 0.32156862745098036, 0.453651, 0.103848, 0.430498, 0.3254901960784314, 0.459875, 0.106089, 0.429846, 0.32941176470588235, 0.4661, 0.108322, 0.429125, 0.3333333333333333, 0.472328, 0.110547, 0.428334, 0.33725490196078434, 0.478558, 0.112764, 0.427475, 0.3411764705882353, 0.484789, 0.114974, 0.426548, 0.34509803921568627, 0.491022, 0.117179, 0.425552, 0.34901960784313724, 0.497257, 0.119379, 0.424488, 0.3529411764705882, 0.503493, 0.121575, 0.423356, 0.3568627450980392, 0.50973, 0.123769, 0.422156, 0.3607843137254902, 0.515967, 0.12596, 0.420887, 0.36470588235294116, 0.522206, 0.12815, 0.419549, 0.3686274509803922, 0.528444, 0.130341, 0.418142, 0.37254901960784315, 0.534683, 0.132534, 0.416667, 0.3764705882352941, 0.54092, 0.134729, 0.415123, 0.3803921568627451, 0.547157, 0.136929, 0.413511, 0.38431372549019605, 0.553392, 0.139134, 0.411829, 0.38823529411764707, 0.559624, 0.141346, 0.410078, 0.39215686274509803, 0.565854, 0.143567, 0.408258, 0.396078431372549, 0.572081, 0.145797, 0.406369, 0.4, 0.578304, 0.148039, 0.404411, 0.403921568627451, 0.584521, 0.150294, 0.402385, 0.40784313725490196, 0.590734, 0.152563, 0.40029, 0.4117647058823529, 0.59694, 0.154848, 0.398125, 0.4156862745098039, 0.603139, 0.157151, 0.395891, 0.4196078431372549, 0.60933, 0.159474, 0.393589, 0.4235294117647059, 0.615513, 0.161817, 0.391219, 0.42745098039215684, 0.621685, 0.164184, 0.388781, 0.43137254901960786, 0.627847, 0.166575, 0.386276, 0.43529411764705883, 0.633998, 0.168992, 0.383704, 0.4392156862745098, 0.640135, 0.171438, 0.381065, 0.44313725490196076, 0.64626, 0.173914, 0.378359, 0.44705882352941173, 0.652369, 0.176421, 0.375586, 0.45098039215686275, 0.658463, 0.178962, 0.372748, 0.4549019607843137, 0.66454, 0.181539, 0.369846, 0.4588235294117647, 0.670599, 0.184153, 0.366879, 0.4627450980392157, 0.676638, 0.186807, 0.363849, 0.4666666666666667, 0.682656, 0.189501, 0.360757, 0.47058823529411764, 0.688653, 0.192239, 0.357603, 0.4745098039215686, 0.694627, 0.195021, 0.354388, 0.4784313725490196, 0.700576, 0.197851, 0.351113, 0.4823529411764706, 0.7065, 0.200728, 0.347777, 0.48627450980392156, 0.712396, 0.203656, 0.344383, 0.49019607843137253, 0.718264, 0.206636, 0.340931, 0.49411764705882355, 0.724103, 0.20967, 0.337424, 0.4980392156862745, 0.729909, 0.212759, 0.333861, 0.5019607843137255, 0.735683, 0.215906, 0.330245, 0.5058823529411764, 0.741423, 0.219112, 0.326576, 0.5098039215686274, 0.747127, 0.222378, 0.322856, 0.5137254901960784, 0.752794, 0.225706, 0.319085, 0.5176470588235293, 0.758422, 0.229097, 0.315266, 0.5215686274509804, 0.76401, 0.232554, 0.311399, 0.5254901960784314, 0.769556, 0.236077, 0.307485, 0.5294117647058824, 0.775059, 0.239667, 0.303526, 0.5333333333333333, 0.780517, 0.243327, 0.299523, 0.5372549019607843, 0.785929, 0.247056, 0.295477, 0.5411764705882353, 0.791293, 0.250856, 0.29139, 0.5450980392156862, 0.796607, 0.254728, 0.287264, 0.5490196078431373, 0.801871, 0.258674, 0.283099, 0.5529411764705883, 0.807082, 0.262692, 0.278898, 0.5568627450980392, 0.812239, 0.266786, 0.274661, 0.5607843137254902, 0.817341, 0.270954, 0.27039, 0.5647058823529412, 0.822386, 0.275197, 0.266085, 0.5686274509803921, 0.827372, 0.279517, 0.26175, 0.5725490196078431, 0.832299, 0.283913, 0.257383, 0.5764705882352941, 0.837165, 0.288385, 0.252988, 0.580392156862745, 0.841969, 0.292933, 0.248564, 0.5843137254901961, 0.846709, 0.297559, 0.244113, 0.5882352941176471, 0.851384, 0.30226, 0.239636, 0.592156862745098, 0.855992, 0.307038, 0.235133, 0.596078431372549, 0.860533, 0.311892, 0.230606, 0.6, 0.865006, 0.316822, 0.226055, 0.6039215686274509, 0.869409, 0.321827, 0.221482, 0.6078431372549019, 0.873741, 0.326906, 0.216886, 0.611764705882353, 0.878001, 0.33206, 0.212268, 0.615686274509804, 0.882188, 0.337287, 0.207628, 0.6196078431372549, 0.886302, 0.342586, 0.202968, 0.6235294117647059, 0.890341, 0.347957, 0.198286, 0.6274509803921569, 0.894305, 0.353399, 0.193584, 0.6313725490196078, 0.898192, 0.358911, 0.18886, 0.6352941176470588, 0.902003, 0.364492, 0.184116, 0.6392156862745098, 0.905735, 0.37014, 0.17935, 0.6431372549019607, 0.90939, 0.375856, 0.174563, 0.6470588235294118, 0.912966, 0.381636, 0.169755, 0.6509803921568628, 0.916462, 0.387481, 0.164924, 0.6549019607843137, 0.919879, 0.393389, 0.16007, 0.6588235294117647, 0.923215, 0.399359, 0.155193, 0.6627450980392157, 0.92647, 0.405389, 0.150292, 0.6666666666666666, 0.929644, 0.411479, 0.145367, 0.6705882352941176, 0.932737, 0.417627, 0.140417, 0.6745098039215687, 0.935747, 0.423831, 0.13544, 0.6784313725490196, 0.938675, 0.430091, 0.130438, 0.6823529411764706, 0.941521, 0.436405, 0.125409, 0.6862745098039216, 0.944285, 0.442772, 0.120354, 0.6901960784313725, 0.946965, 0.449191, 0.115272, 0.6941176470588235, 0.949562, 0.45566, 0.110164, 0.6980392156862745, 0.952075, 0.462178, 0.105031, 0.7019607843137254, 0.954506, 0.468744, 0.099874, 0.7058823529411764, 0.956852, 0.475356, 0.094695, 0.7098039215686275, 0.959114, 0.482014, 0.089499, 0.7137254901960784, 0.961293, 0.488716, 0.084289, 0.7176470588235294, 0.963387, 0.495462, 0.079073, 0.7215686274509804, 0.965397, 0.502249, 0.073859, 0.7254901960784313, 0.967322, 0.509078, 0.068659, 0.7294117647058823, 0.969163, 0.515946, 0.063488, 0.7333333333333333, 0.970919, 0.522853, 0.058367, 0.7372549019607844, 0.97259, 0.529798, 0.053324, 0.7411764705882353, 0.974176, 0.53678, 0.048392, 0.7450980392156863, 0.975677, 0.543798, 0.043618, 0.7490196078431373, 0.977092, 0.55085, 0.03905, 0.7529411764705882, 0.978422, 0.557937, 0.034931, 0.7568627450980392, 0.979666, 0.565057, 0.031409, 0.7607843137254902, 0.980824, 0.572209, 0.028508, 0.7647058823529411, 0.981895, 0.579392, 0.02625, 0.7686274509803921, 0.982881, 0.586606, 0.024661, 0.7725490196078432, 0.983779, 0.593849, 0.02377, 0.7764705882352941, 0.984591, 0.601122, 0.023606, 0.7803921568627451, 0.985315, 0.608422, 0.024202, 0.7843137254901961, 0.985952, 0.61575, 0.025592, 0.788235294117647, 0.986502, 0.623105, 0.027814, 0.792156862745098, 0.986964, 0.630485, 0.030908, 0.796078431372549, 0.987337, 0.63789, 0.034916, 0.8, 0.987622, 0.64532, 0.039886, 0.803921568627451, 0.987819, 0.652773, 0.045581, 0.807843137254902, 0.987926, 0.66025, 0.05175, 0.8117647058823529, 0.987945, 0.667748, 0.058329, 0.8156862745098039, 0.987874, 0.675267, 0.065257, 0.8196078431372549, 0.987714, 0.682807, 0.072489, 0.8235294117647058, 0.987464, 0.690366, 0.07999, 0.8274509803921568, 0.987124, 0.697944, 0.087731, 0.8313725490196078, 0.986694, 0.70554, 0.095694, 0.8352941176470589, 0.986175, 0.713153, 0.103863, 0.8392156862745098, 0.985566, 0.720782, 0.112229, 0.8431372549019608, 0.984865, 0.728427, 0.120785, 0.8470588235294118, 0.984075, 0.736087, 0.129527, 0.8509803921568627, 0.983196, 0.743758, 0.138453, 0.8549019607843137, 0.982228, 0.751442, 0.147565, 0.8588235294117647, 0.981173, 0.759135, 0.156863, 0.8627450980392157, 0.980032, 0.766837, 0.166353, 0.8666666666666667, 0.978806, 0.774545, 0.176037, 0.8705882352941177, 0.977497, 0.782258, 0.185923, 0.8745098039215686, 0.976108, 0.789974, 0.196018, 0.8784313725490196, 0.974638, 0.797692, 0.206332, 0.8823529411764706, 0.973088, 0.805409, 0.216877, 0.8862745098039215, 0.971468, 0.813122, 0.227658, 0.8901960784313725, 0.969783, 0.820825, 0.238686, 0.8941176470588235, 0.968041, 0.828515, 0.249972, 0.8980392156862745, 0.966243, 0.836191, 0.261534, 0.9019607843137255, 0.964394, 0.843848, 0.273391, 0.9058823529411765, 0.962517, 0.851476, 0.285546, 0.9098039215686274, 0.960626, 0.859069, 0.29801, 0.9137254901960784, 0.95872, 0.866624, 0.31082, 0.9176470588235294, 0.956834, 0.874129, 0.323974, 0.9215686274509803, 0.954997, 0.881569, 0.337475, 0.9254901960784314, 0.953215, 0.888942, 0.351369, 0.9294117647058824, 0.951546, 0.896226, 0.365627, 0.9333333333333333, 0.950018, 0.903409, 0.380271, 0.9372549019607843, 0.948683, 0.910473, 0.395289, 0.9411764705882353, 0.947594, 0.917399, 0.410665, 0.9450980392156862, 0.946809, 0.924168, 0.426373, 0.9490196078431372, 0.946392, 0.930761, 0.442367, 0.9529411764705882, 0.946403, 0.937159, 0.458592, 0.9568627450980391, 0.946903, 0.943348, 0.47497, 0.9607843137254902, 0.947937, 0.949318, 0.491426, 0.9647058823529412, 0.949545, 0.955063, 0.50786, 0.9686274509803922, 0.95174, 0.960587, 0.524203, 0.9725490196078431, 0.954529, 0.965896, 0.540361, 0.9764705882352941, 0.957896, 0.971003, 0.556275, 0.9803921568627451, 0.961812, 0.975924, 0.571925, 0.984313725490196, 0.966249, 0.980678, 0.587206, 0.9882352941176471, 0.971162, 0.985282, 0.602154, 0.9921568627450981, 0.976511, 0.989753, 0.61676, 0.996078431372549, 0.982257, 0.994109, 0.631017, 1.0, 0.988362, 0.998364, 0.644924], opacity_function=None, color_range=[], samples=512.0, gradient_step=0.005, name=None, compression_level=0, **kwargs)[source]

Create a MIP drawable for 3D volumetric data.

By default, the volume are a grid inscribed in the -0.5 < x, y, z < 0.5 cube regardless of the passed voxel array shape (aspect ratio etc.). Different grid size, shape and rotation can be obtained using kwargs:

mip(…, bounds=[0, 300, 0, 400, 0, 500])

or:

mip(…, scaling=[scale_x, scale_y, scale_z]).

Arguments:
volume: array_like.

3D array of float

color_map: list.

A list of float quadruplets (attribute value, R, G, B), sorted by attribute value. The first quadruplet should have value 0.0, the last 1.0; R, G, B are RGB color components in the range 0.0 to 1.0.

opacity_function: array.

A list of float tuples (attribute value, opacity), sorted by attribute value. The first typles should have value 0.0, the last 1.0; opacity is in the range 0.0 to 1.0.

color_range: list.

A pair [min_value, max_value], which determines the levels of volume attribute mapped to 0 and 1 in the color map respectively.

samples: float.

Number of iteration per 1 unit of space.

gradient_step: float.

Gradient light step.

name: string.

A name of a object

kwargs: dict.

Dictionary arguments to configure transform and model_matrix.

k3d.factory.plot(height=512, antialias=3, background_color=16777215, camera_auto_fit=True, grid_auto_fit=True, grid_visible=True, screenshot_scale=2.0, grid=- 1, - 1, - 1, 1, 1, 1, grid_color=15132390, lighting=1.5, menu_visibility=True, voxel_paint_color=0, colorbar_object_id=- 1, camera_fov=60.0, time=0.0, axes=['x', 'y', 'z'], axes_helper=1.0, name=None, camera_mode='trackball', snapshot_include_js=True, auto_rendering=True, camera_no_zoom=False, camera_no_rotate=False, camera_no_pan=False, camera_rotate_speed=1.0, camera_zoom_speed=1.2, camera_pan_speed=0.3, fps=25.0)[source]

Create a K3D Plot widget.

This creates the main widget for displaying 3D objects.

Arguments:
height: int.

Height of the widget in pixels.

antialias: bool.

Enable antialiasing in WebGL renderer.

background_color: int.

Packed RGB color of the plot background (0xff0000 is red, 0xff is blue).

camera_auto_fit: bool.

Enable automatic camera setting after adding, removing or changing a plot object.

grid_auto_fit: bool.

Enable automatic adjustment of the plot grid to contained objects.

grid_visible: bool.

Enable or disable grid.

grid_color: int.

Packed RGB color of the plot grids (0xff0000 is red, 0xff is blue).

grid: array_like.

6-element tuple specifying the bounds of the plot grid (x0, y0, z0, x1, y1, z1).

screenshot_scale: Float.

Multipiler to screenshot resolution.

lighting: Float.

Lighting factor.

menu_visibility: bool.

Enable menu on GUI.

voxel_paint_color: int.

The (initial) int value to be inserted when editing voxels.

camera_no_rotate: Bool.

Lock for camera rotation.

camera_no_zoom: Bool.

Lock for camera zoom.

camera_no_pan: Bool.

Lock for camera pan.

camera_rotate_speed: Float.

Speed of camera rotation.

camera_zoom_speed: Float.

Speed of camera zoom.

camera_pan_speed: Float.

Speed of camera pan.

camera_fov: Float.

Camera Field of View.

snapshot_include_js: Bool.

If it’s true snapshot html is standalone.

axes: list.

Axes labels for plot.

axes_helper: Float.

Axes helper size.

time: list.

Time value (used in TimeSeries)

name: string.

Name of the plot. Used to filenames of snapshot/screenshot etc.

camera_mode: str.

Mode of camera.

Legal values are:

trackball

orbit around point with dynamic up-vector of camera,

orbit

orbit around point with fixed up-vector of camera,

fly

orbit around point with dynamic up-vector of camera, wheel on mouse change also target point.

auto_rendering: Bool.

State of auto rendering.

fps: Float.

Fps of animation.

grid: array_like.

6-element tuple specifying the bounds of the plot grid (x0, y0, z0, x1, y1, z1).

k3d.factory.points(positions, colors=[], color=255, point_size=1.0, shader='3dSpecular', opacity=1.0, opacities=[], attribute=[], color_map=[0.0, 0.001462, 0.000466, 0.013866, 0.00392156862745098, 0.002267, 0.00127, 0.01857, 0.00784313725490196, 0.003299, 0.002249, 0.024239, 0.011764705882352941, 0.004547, 0.003392, 0.030909, 0.01568627450980392, 0.006006, 0.004692, 0.038558, 0.0196078431372549, 0.007676, 0.006136, 0.046836, 0.023529411764705882, 0.009561, 0.007713, 0.055143, 0.027450980392156862, 0.011663, 0.009417, 0.06346, 0.03137254901960784, 0.013995, 0.011225, 0.071862, 0.03529411764705882, 0.016561, 0.013136, 0.080282, 0.0392156862745098, 0.019373, 0.015133, 0.088767, 0.043137254901960784, 0.022447, 0.017199, 0.097327, 0.047058823529411764, 0.025793, 0.019331, 0.10593, 0.050980392156862744, 0.029432, 0.021503, 0.114621, 0.054901960784313725, 0.033385, 0.023702, 0.123397, 0.058823529411764705, 0.037668, 0.025921, 0.132232, 0.06274509803921569, 0.042253, 0.028139, 0.141141, 0.06666666666666667, 0.046915, 0.030324, 0.150164, 0.07058823529411765, 0.051644, 0.032474, 0.159254, 0.07450980392156863, 0.056449, 0.034569, 0.168414, 0.0784313725490196, 0.06134, 0.03659, 0.177642, 0.08235294117647059, 0.066331, 0.038504, 0.186962, 0.08627450980392157, 0.071429, 0.040294, 0.196354, 0.09019607843137255, 0.076637, 0.041905, 0.205799, 0.09411764705882353, 0.081962, 0.043328, 0.215289, 0.09803921568627451, 0.087411, 0.044556, 0.224813, 0.10196078431372549, 0.09299, 0.045583, 0.234358, 0.10588235294117647, 0.098702, 0.046402, 0.243904, 0.10980392156862745, 0.104551, 0.047008, 0.25343, 0.11372549019607843, 0.110536, 0.047399, 0.262912, 0.11764705882352941, 0.116656, 0.047574, 0.272321, 0.12156862745098039, 0.122908, 0.047536, 0.281624, 0.12549019607843137, 0.129285, 0.047293, 0.290788, 0.12941176470588234, 0.135778, 0.046856, 0.299776, 0.13333333333333333, 0.142378, 0.046242, 0.308553, 0.13725490196078433, 0.149073, 0.045468, 0.317085, 0.1411764705882353, 0.15585, 0.044559, 0.325338, 0.14509803921568626, 0.162689, 0.043554, 0.333277, 0.14901960784313725, 0.169575, 0.042489, 0.340874, 0.15294117647058825, 0.176493, 0.041402, 0.348111, 0.1568627450980392, 0.183429, 0.040329, 0.354971, 0.16078431372549018, 0.190367, 0.039309, 0.361447, 0.16470588235294117, 0.197297, 0.0384, 0.367535, 0.16862745098039217, 0.204209, 0.037632, 0.373238, 0.17254901960784313, 0.211095, 0.03703, 0.378563, 0.1764705882352941, 0.217949, 0.036615, 0.383522, 0.1803921568627451, 0.224763, 0.036405, 0.388129, 0.1843137254901961, 0.231538, 0.036405, 0.3924, 0.18823529411764706, 0.238273, 0.036621, 0.396353, 0.19215686274509802, 0.244967, 0.037055, 0.400007, 0.19607843137254902, 0.25162, 0.037705, 0.403378, 0.2, 0.258234, 0.038571, 0.406485, 0.20392156862745098, 0.26481, 0.039647, 0.409345, 0.20784313725490194, 0.271347, 0.040922, 0.411976, 0.21176470588235294, 0.27785, 0.042353, 0.414392, 0.21568627450980393, 0.284321, 0.043933, 0.416608, 0.2196078431372549, 0.290763, 0.045644, 0.418637, 0.22352941176470587, 0.297178, 0.04747, 0.420491, 0.22745098039215686, 0.303568, 0.049396, 0.422182, 0.23137254901960785, 0.309935, 0.051407, 0.423721, 0.23529411764705882, 0.316282, 0.05349, 0.425116, 0.2392156862745098, 0.32261, 0.055634, 0.426377, 0.24313725490196078, 0.328921, 0.057827, 0.427511, 0.24705882352941178, 0.335217, 0.06006, 0.428524, 0.25098039215686274, 0.3415, 0.062325, 0.429425, 0.2549019607843137, 0.347771, 0.064616, 0.430217, 0.2588235294117647, 0.354032, 0.066925, 0.430906, 0.2627450980392157, 0.360284, 0.069247, 0.431497, 0.26666666666666666, 0.366529, 0.071579, 0.431994, 0.27058823529411763, 0.372768, 0.073915, 0.4324, 0.27450980392156865, 0.379001, 0.076253, 0.432719, 0.2784313725490196, 0.385228, 0.078591, 0.432955, 0.2823529411764706, 0.391453, 0.080927, 0.433109, 0.28627450980392155, 0.397674, 0.083257, 0.433183, 0.2901960784313725, 0.403894, 0.08558, 0.433179, 0.29411764705882354, 0.410113, 0.087896, 0.433098, 0.2980392156862745, 0.416331, 0.090203, 0.432943, 0.30196078431372547, 0.422549, 0.092501, 0.432714, 0.3058823529411765, 0.428768, 0.09479, 0.432412, 0.30980392156862746, 0.434987, 0.097069, 0.432039, 0.3137254901960784, 0.441207, 0.099338, 0.431594, 0.3176470588235294, 0.447428, 0.101597, 0.43108, 0.32156862745098036, 0.453651, 0.103848, 0.430498, 0.3254901960784314, 0.459875, 0.106089, 0.429846, 0.32941176470588235, 0.4661, 0.108322, 0.429125, 0.3333333333333333, 0.472328, 0.110547, 0.428334, 0.33725490196078434, 0.478558, 0.112764, 0.427475, 0.3411764705882353, 0.484789, 0.114974, 0.426548, 0.34509803921568627, 0.491022, 0.117179, 0.425552, 0.34901960784313724, 0.497257, 0.119379, 0.424488, 0.3529411764705882, 0.503493, 0.121575, 0.423356, 0.3568627450980392, 0.50973, 0.123769, 0.422156, 0.3607843137254902, 0.515967, 0.12596, 0.420887, 0.36470588235294116, 0.522206, 0.12815, 0.419549, 0.3686274509803922, 0.528444, 0.130341, 0.418142, 0.37254901960784315, 0.534683, 0.132534, 0.416667, 0.3764705882352941, 0.54092, 0.134729, 0.415123, 0.3803921568627451, 0.547157, 0.136929, 0.413511, 0.38431372549019605, 0.553392, 0.139134, 0.411829, 0.38823529411764707, 0.559624, 0.141346, 0.410078, 0.39215686274509803, 0.565854, 0.143567, 0.408258, 0.396078431372549, 0.572081, 0.145797, 0.406369, 0.4, 0.578304, 0.148039, 0.404411, 0.403921568627451, 0.584521, 0.150294, 0.402385, 0.40784313725490196, 0.590734, 0.152563, 0.40029, 0.4117647058823529, 0.59694, 0.154848, 0.398125, 0.4156862745098039, 0.603139, 0.157151, 0.395891, 0.4196078431372549, 0.60933, 0.159474, 0.393589, 0.4235294117647059, 0.615513, 0.161817, 0.391219, 0.42745098039215684, 0.621685, 0.164184, 0.388781, 0.43137254901960786, 0.627847, 0.166575, 0.386276, 0.43529411764705883, 0.633998, 0.168992, 0.383704, 0.4392156862745098, 0.640135, 0.171438, 0.381065, 0.44313725490196076, 0.64626, 0.173914, 0.378359, 0.44705882352941173, 0.652369, 0.176421, 0.375586, 0.45098039215686275, 0.658463, 0.178962, 0.372748, 0.4549019607843137, 0.66454, 0.181539, 0.369846, 0.4588235294117647, 0.670599, 0.184153, 0.366879, 0.4627450980392157, 0.676638, 0.186807, 0.363849, 0.4666666666666667, 0.682656, 0.189501, 0.360757, 0.47058823529411764, 0.688653, 0.192239, 0.357603, 0.4745098039215686, 0.694627, 0.195021, 0.354388, 0.4784313725490196, 0.700576, 0.197851, 0.351113, 0.4823529411764706, 0.7065, 0.200728, 0.347777, 0.48627450980392156, 0.712396, 0.203656, 0.344383, 0.49019607843137253, 0.718264, 0.206636, 0.340931, 0.49411764705882355, 0.724103, 0.20967, 0.337424, 0.4980392156862745, 0.729909, 0.212759, 0.333861, 0.5019607843137255, 0.735683, 0.215906, 0.330245, 0.5058823529411764, 0.741423, 0.219112, 0.326576, 0.5098039215686274, 0.747127, 0.222378, 0.322856, 0.5137254901960784, 0.752794, 0.225706, 0.319085, 0.5176470588235293, 0.758422, 0.229097, 0.315266, 0.5215686274509804, 0.76401, 0.232554, 0.311399, 0.5254901960784314, 0.769556, 0.236077, 0.307485, 0.5294117647058824, 0.775059, 0.239667, 0.303526, 0.5333333333333333, 0.780517, 0.243327, 0.299523, 0.5372549019607843, 0.785929, 0.247056, 0.295477, 0.5411764705882353, 0.791293, 0.250856, 0.29139, 0.5450980392156862, 0.796607, 0.254728, 0.287264, 0.5490196078431373, 0.801871, 0.258674, 0.283099, 0.5529411764705883, 0.807082, 0.262692, 0.278898, 0.5568627450980392, 0.812239, 0.266786, 0.274661, 0.5607843137254902, 0.817341, 0.270954, 0.27039, 0.5647058823529412, 0.822386, 0.275197, 0.266085, 0.5686274509803921, 0.827372, 0.279517, 0.26175, 0.5725490196078431, 0.832299, 0.283913, 0.257383, 0.5764705882352941, 0.837165, 0.288385, 0.252988, 0.580392156862745, 0.841969, 0.292933, 0.248564, 0.5843137254901961, 0.846709, 0.297559, 0.244113, 0.5882352941176471, 0.851384, 0.30226, 0.239636, 0.592156862745098, 0.855992, 0.307038, 0.235133, 0.596078431372549, 0.860533, 0.311892, 0.230606, 0.6, 0.865006, 0.316822, 0.226055, 0.6039215686274509, 0.869409, 0.321827, 0.221482, 0.6078431372549019, 0.873741, 0.326906, 0.216886, 0.611764705882353, 0.878001, 0.33206, 0.212268, 0.615686274509804, 0.882188, 0.337287, 0.207628, 0.6196078431372549, 0.886302, 0.342586, 0.202968, 0.6235294117647059, 0.890341, 0.347957, 0.198286, 0.6274509803921569, 0.894305, 0.353399, 0.193584, 0.6313725490196078, 0.898192, 0.358911, 0.18886, 0.6352941176470588, 0.902003, 0.364492, 0.184116, 0.6392156862745098, 0.905735, 0.37014, 0.17935, 0.6431372549019607, 0.90939, 0.375856, 0.174563, 0.6470588235294118, 0.912966, 0.381636, 0.169755, 0.6509803921568628, 0.916462, 0.387481, 0.164924, 0.6549019607843137, 0.919879, 0.393389, 0.16007, 0.6588235294117647, 0.923215, 0.399359, 0.155193, 0.6627450980392157, 0.92647, 0.405389, 0.150292, 0.6666666666666666, 0.929644, 0.411479, 0.145367, 0.6705882352941176, 0.932737, 0.417627, 0.140417, 0.6745098039215687, 0.935747, 0.423831, 0.13544, 0.6784313725490196, 0.938675, 0.430091, 0.130438, 0.6823529411764706, 0.941521, 0.436405, 0.125409, 0.6862745098039216, 0.944285, 0.442772, 0.120354, 0.6901960784313725, 0.946965, 0.449191, 0.115272, 0.6941176470588235, 0.949562, 0.45566, 0.110164, 0.6980392156862745, 0.952075, 0.462178, 0.105031, 0.7019607843137254, 0.954506, 0.468744, 0.099874, 0.7058823529411764, 0.956852, 0.475356, 0.094695, 0.7098039215686275, 0.959114, 0.482014, 0.089499, 0.7137254901960784, 0.961293, 0.488716, 0.084289, 0.7176470588235294, 0.963387, 0.495462, 0.079073, 0.7215686274509804, 0.965397, 0.502249, 0.073859, 0.7254901960784313, 0.967322, 0.509078, 0.068659, 0.7294117647058823, 0.969163, 0.515946, 0.063488, 0.7333333333333333, 0.970919, 0.522853, 0.058367, 0.7372549019607844, 0.97259, 0.529798, 0.053324, 0.7411764705882353, 0.974176, 0.53678, 0.048392, 0.7450980392156863, 0.975677, 0.543798, 0.043618, 0.7490196078431373, 0.977092, 0.55085, 0.03905, 0.7529411764705882, 0.978422, 0.557937, 0.034931, 0.7568627450980392, 0.979666, 0.565057, 0.031409, 0.7607843137254902, 0.980824, 0.572209, 0.028508, 0.7647058823529411, 0.981895, 0.579392, 0.02625, 0.7686274509803921, 0.982881, 0.586606, 0.024661, 0.7725490196078432, 0.983779, 0.593849, 0.02377, 0.7764705882352941, 0.984591, 0.601122, 0.023606, 0.7803921568627451, 0.985315, 0.608422, 0.024202, 0.7843137254901961, 0.985952, 0.61575, 0.025592, 0.788235294117647, 0.986502, 0.623105, 0.027814, 0.792156862745098, 0.986964, 0.630485, 0.030908, 0.796078431372549, 0.987337, 0.63789, 0.034916, 0.8, 0.987622, 0.64532, 0.039886, 0.803921568627451, 0.987819, 0.652773, 0.045581, 0.807843137254902, 0.987926, 0.66025, 0.05175, 0.8117647058823529, 0.987945, 0.667748, 0.058329, 0.8156862745098039, 0.987874, 0.675267, 0.065257, 0.8196078431372549, 0.987714, 0.682807, 0.072489, 0.8235294117647058, 0.987464, 0.690366, 0.07999, 0.8274509803921568, 0.987124, 0.697944, 0.087731, 0.8313725490196078, 0.986694, 0.70554, 0.095694, 0.8352941176470589, 0.986175, 0.713153, 0.103863, 0.8392156862745098, 0.985566, 0.720782, 0.112229, 0.8431372549019608, 0.984865, 0.728427, 0.120785, 0.8470588235294118, 0.984075, 0.736087, 0.129527, 0.8509803921568627, 0.983196, 0.743758, 0.138453, 0.8549019607843137, 0.982228, 0.751442, 0.147565, 0.8588235294117647, 0.981173, 0.759135, 0.156863, 0.8627450980392157, 0.980032, 0.766837, 0.166353, 0.8666666666666667, 0.978806, 0.774545, 0.176037, 0.8705882352941177, 0.977497, 0.782258, 0.185923, 0.8745098039215686, 0.976108, 0.789974, 0.196018, 0.8784313725490196, 0.974638, 0.797692, 0.206332, 0.8823529411764706, 0.973088, 0.805409, 0.216877, 0.8862745098039215, 0.971468, 0.813122, 0.227658, 0.8901960784313725, 0.969783, 0.820825, 0.238686, 0.8941176470588235, 0.968041, 0.828515, 0.249972, 0.8980392156862745, 0.966243, 0.836191, 0.261534, 0.9019607843137255, 0.964394, 0.843848, 0.273391, 0.9058823529411765, 0.962517, 0.851476, 0.285546, 0.9098039215686274, 0.960626, 0.859069, 0.29801, 0.9137254901960784, 0.95872, 0.866624, 0.31082, 0.9176470588235294, 0.956834, 0.874129, 0.323974, 0.9215686274509803, 0.954997, 0.881569, 0.337475, 0.9254901960784314, 0.953215, 0.888942, 0.351369, 0.9294117647058824, 0.951546, 0.896226, 0.365627, 0.9333333333333333, 0.950018, 0.903409, 0.380271, 0.9372549019607843, 0.948683, 0.910473, 0.395289, 0.9411764705882353, 0.947594, 0.917399, 0.410665, 0.9450980392156862, 0.946809, 0.924168, 0.426373, 0.9490196078431372, 0.946392, 0.930761, 0.442367, 0.9529411764705882, 0.946403, 0.937159, 0.458592, 0.9568627450980391, 0.946903, 0.943348, 0.47497, 0.9607843137254902, 0.947937, 0.949318, 0.491426, 0.9647058823529412, 0.949545, 0.955063, 0.50786, 0.9686274509803922, 0.95174, 0.960587, 0.524203, 0.9725490196078431, 0.954529, 0.965896, 0.540361, 0.9764705882352941, 0.957896, 0.971003, 0.556275, 0.9803921568627451, 0.961812, 0.975924, 0.571925, 0.984313725490196, 0.966249, 0.980678, 0.587206, 0.9882352941176471, 0.971162, 0.985282, 0.602154, 0.9921568627450981, 0.976511, 0.989753, 0.61676, 0.996078431372549, 0.982257, 0.994109, 0.631017, 1.0, 0.988362, 0.998364, 0.644924], color_range=[], opacity_function=[], name=None, compression_level=0, mesh_detail=2, **kwargs)[source]

Create a Points drawable representing a point cloud.

Arguments:
positions: array_like.

Array with (x, y, z) coordinates of the points.

colors: array_like.

Same-length array of int-packed RGB color of the points (0xff0000 is red, 0xff is blue).

color: int.

Packed RGB color of the points (0xff0000 is red, 0xff is blue) when colors is empty.

opacity: float.

Opacity of points.

opacities: array_like.

Same-length array of float opacity of the points.

point_size: float.

Diameter of the balls representing the points in 3D space.

shader: str.

Display style (name of the shader used) of the points. Legal values are:

flat

simple circles with uniform color,

dot

simple dot with uniform color,

3d

little 3D balls,

3dSpecular

little 3D balls with specular lightning,

mesh

high precision triangle mesh of a ball (high quality and GPU load).

mesh_detail: int.

Default is 2. Setting this to a value greater than 0 adds more vertices making it no longer an icosahedron. When detail is greater than 1, it’s effectively a sphere. Only valid if shader=’mesh’

attribute: array_like.

Array of float attribute for the color mapping, coresponding to each point.

color_map: list.

A list of float quadruplets (attribute value, R, G, B), sorted by attribute value. The first quadruplet should have value 0.0, the last 1.0; R, G, B are RGB color components in the range 0.0 to 1.0.

color_range: list.

A pair [min_value, max_value], which determines the levels of color attribute mapped to 0 and 1 in the color map respectively.

opacity_function: array.

A list of float tuples (attribute value, opacity), sorted by attribute value. The first tuples should have value 0.0, the last 1.0; opacity is in the range 0.0 to 1.0.

name: string.

A name of a object

kwargs: dict.

Dictionary arguments to configure transform and model_matrix.

k3d.factory.sparse_voxels(sparse_voxels, space_size, color_map=15079755, 3978315, 16769305, 33480, 16089649, 9510580, 4649200, 15741670, 13825340, 16432830, 32896, 15122175, 11169320, 16775880, 8388608, 11206595, 8421376, 16767153, 128, 8421504, 16777215, 0, wireframe=False, outlines=True, outlines_color=0, opacity=1.0, name=None, compression_level=0, bounds=None, **kwargs)[source]

Create a Voxels drawable for 3D volumetric data.

Different grid size, shape and rotation can be obtained using kwargs:

voxels(…, bounds=[0, 300, 0, 400, 0, 500])

or:

voxels(…, scaling=[scale_x, scale_y, scale_z]).

Arguments:
sparse_voxels: array_like.

2D array of coords in format [[x,y,z,v], [x,y,z,v]]. x, y, z >= 0 v = 0 means empty voxel, 1 and above refer to consecutive color_map entries.

space_size: array_like.

Width, Height, Length of space

color_map: array_like.

Flat array of int packed RGB colors (0xff0000 is red, 0xff is blue).

wireframe: bool.

Whether mesh should display as wireframe.

opacity: float.

Opacity of voxels.

outlines: bool.

Whether mesh should display with outlines.

outlines_color: int.

Packed RGB color of the resulting outlines (0xff0000 is red, 0xff is blue)

name: string.

A name of a object

kwargs: dict.

Dictionary arguments to configure transform and model_matrix.

k3d.factory.stl(stl, color=255, wireframe=False, flat_shading=True, name=None, compression_level=0, **kwargs)[source]

Create an STL drawable for data in STereoLitograpy format.

Arguments:
stl: str or bytes.

STL data in either ASCII STL (string) or Binary STL (bytes).

color: int.

Packed RGB color of the resulting mesh (0xff0000 is red, 0xff is blue).

wireframe: bool.

Whether mesh should display as wireframe.

flat_shading: bool.

Whether mesh should display with flat shading.

name: string.

A name of a object

kwargs: dict.

Dictionary arguments to configure transform and model_matrix.

k3d.factory.surface(heights, color=255, wireframe=False, flat_shading=True, attribute=[], color_map=[0.0, 0.001462, 0.000466, 0.013866, 0.00392156862745098, 0.002267, 0.00127, 0.01857, 0.00784313725490196, 0.003299, 0.002249, 0.024239, 0.011764705882352941, 0.004547, 0.003392, 0.030909, 0.01568627450980392, 0.006006, 0.004692, 0.038558, 0.0196078431372549, 0.007676, 0.006136, 0.046836, 0.023529411764705882, 0.009561, 0.007713, 0.055143, 0.027450980392156862, 0.011663, 0.009417, 0.06346, 0.03137254901960784, 0.013995, 0.011225, 0.071862, 0.03529411764705882, 0.016561, 0.013136, 0.080282, 0.0392156862745098, 0.019373, 0.015133, 0.088767, 0.043137254901960784, 0.022447, 0.017199, 0.097327, 0.047058823529411764, 0.025793, 0.019331, 0.10593, 0.050980392156862744, 0.029432, 0.021503, 0.114621, 0.054901960784313725, 0.033385, 0.023702, 0.123397, 0.058823529411764705, 0.037668, 0.025921, 0.132232, 0.06274509803921569, 0.042253, 0.028139, 0.141141, 0.06666666666666667, 0.046915, 0.030324, 0.150164, 0.07058823529411765, 0.051644, 0.032474, 0.159254, 0.07450980392156863, 0.056449, 0.034569, 0.168414, 0.0784313725490196, 0.06134, 0.03659, 0.177642, 0.08235294117647059, 0.066331, 0.038504, 0.186962, 0.08627450980392157, 0.071429, 0.040294, 0.196354, 0.09019607843137255, 0.076637, 0.041905, 0.205799, 0.09411764705882353, 0.081962, 0.043328, 0.215289, 0.09803921568627451, 0.087411, 0.044556, 0.224813, 0.10196078431372549, 0.09299, 0.045583, 0.234358, 0.10588235294117647, 0.098702, 0.046402, 0.243904, 0.10980392156862745, 0.104551, 0.047008, 0.25343, 0.11372549019607843, 0.110536, 0.047399, 0.262912, 0.11764705882352941, 0.116656, 0.047574, 0.272321, 0.12156862745098039, 0.122908, 0.047536, 0.281624, 0.12549019607843137, 0.129285, 0.047293, 0.290788, 0.12941176470588234, 0.135778, 0.046856, 0.299776, 0.13333333333333333, 0.142378, 0.046242, 0.308553, 0.13725490196078433, 0.149073, 0.045468, 0.317085, 0.1411764705882353, 0.15585, 0.044559, 0.325338, 0.14509803921568626, 0.162689, 0.043554, 0.333277, 0.14901960784313725, 0.169575, 0.042489, 0.340874, 0.15294117647058825, 0.176493, 0.041402, 0.348111, 0.1568627450980392, 0.183429, 0.040329, 0.354971, 0.16078431372549018, 0.190367, 0.039309, 0.361447, 0.16470588235294117, 0.197297, 0.0384, 0.367535, 0.16862745098039217, 0.204209, 0.037632, 0.373238, 0.17254901960784313, 0.211095, 0.03703, 0.378563, 0.1764705882352941, 0.217949, 0.036615, 0.383522, 0.1803921568627451, 0.224763, 0.036405, 0.388129, 0.1843137254901961, 0.231538, 0.036405, 0.3924, 0.18823529411764706, 0.238273, 0.036621, 0.396353, 0.19215686274509802, 0.244967, 0.037055, 0.400007, 0.19607843137254902, 0.25162, 0.037705, 0.403378, 0.2, 0.258234, 0.038571, 0.406485, 0.20392156862745098, 0.26481, 0.039647, 0.409345, 0.20784313725490194, 0.271347, 0.040922, 0.411976, 0.21176470588235294, 0.27785, 0.042353, 0.414392, 0.21568627450980393, 0.284321, 0.043933, 0.416608, 0.2196078431372549, 0.290763, 0.045644, 0.418637, 0.22352941176470587, 0.297178, 0.04747, 0.420491, 0.22745098039215686, 0.303568, 0.049396, 0.422182, 0.23137254901960785, 0.309935, 0.051407, 0.423721, 0.23529411764705882, 0.316282, 0.05349, 0.425116, 0.2392156862745098, 0.32261, 0.055634, 0.426377, 0.24313725490196078, 0.328921, 0.057827, 0.427511, 0.24705882352941178, 0.335217, 0.06006, 0.428524, 0.25098039215686274, 0.3415, 0.062325, 0.429425, 0.2549019607843137, 0.347771, 0.064616, 0.430217, 0.2588235294117647, 0.354032, 0.066925, 0.430906, 0.2627450980392157, 0.360284, 0.069247, 0.431497, 0.26666666666666666, 0.366529, 0.071579, 0.431994, 0.27058823529411763, 0.372768, 0.073915, 0.4324, 0.27450980392156865, 0.379001, 0.076253, 0.432719, 0.2784313725490196, 0.385228, 0.078591, 0.432955, 0.2823529411764706, 0.391453, 0.080927, 0.433109, 0.28627450980392155, 0.397674, 0.083257, 0.433183, 0.2901960784313725, 0.403894, 0.08558, 0.433179, 0.29411764705882354, 0.410113, 0.087896, 0.433098, 0.2980392156862745, 0.416331, 0.090203, 0.432943, 0.30196078431372547, 0.422549, 0.092501, 0.432714, 0.3058823529411765, 0.428768, 0.09479, 0.432412, 0.30980392156862746, 0.434987, 0.097069, 0.432039, 0.3137254901960784, 0.441207, 0.099338, 0.431594, 0.3176470588235294, 0.447428, 0.101597, 0.43108, 0.32156862745098036, 0.453651, 0.103848, 0.430498, 0.3254901960784314, 0.459875, 0.106089, 0.429846, 0.32941176470588235, 0.4661, 0.108322, 0.429125, 0.3333333333333333, 0.472328, 0.110547, 0.428334, 0.33725490196078434, 0.478558, 0.112764, 0.427475, 0.3411764705882353, 0.484789, 0.114974, 0.426548, 0.34509803921568627, 0.491022, 0.117179, 0.425552, 0.34901960784313724, 0.497257, 0.119379, 0.424488, 0.3529411764705882, 0.503493, 0.121575, 0.423356, 0.3568627450980392, 0.50973, 0.123769, 0.422156, 0.3607843137254902, 0.515967, 0.12596, 0.420887, 0.36470588235294116, 0.522206, 0.12815, 0.419549, 0.3686274509803922, 0.528444, 0.130341, 0.418142, 0.37254901960784315, 0.534683, 0.132534, 0.416667, 0.3764705882352941, 0.54092, 0.134729, 0.415123, 0.3803921568627451, 0.547157, 0.136929, 0.413511, 0.38431372549019605, 0.553392, 0.139134, 0.411829, 0.38823529411764707, 0.559624, 0.141346, 0.410078, 0.39215686274509803, 0.565854, 0.143567, 0.408258, 0.396078431372549, 0.572081, 0.145797, 0.406369, 0.4, 0.578304, 0.148039, 0.404411, 0.403921568627451, 0.584521, 0.150294, 0.402385, 0.40784313725490196, 0.590734, 0.152563, 0.40029, 0.4117647058823529, 0.59694, 0.154848, 0.398125, 0.4156862745098039, 0.603139, 0.157151, 0.395891, 0.4196078431372549, 0.60933, 0.159474, 0.393589, 0.4235294117647059, 0.615513, 0.161817, 0.391219, 0.42745098039215684, 0.621685, 0.164184, 0.388781, 0.43137254901960786, 0.627847, 0.166575, 0.386276, 0.43529411764705883, 0.633998, 0.168992, 0.383704, 0.4392156862745098, 0.640135, 0.171438, 0.381065, 0.44313725490196076, 0.64626, 0.173914, 0.378359, 0.44705882352941173, 0.652369, 0.176421, 0.375586, 0.45098039215686275, 0.658463, 0.178962, 0.372748, 0.4549019607843137, 0.66454, 0.181539, 0.369846, 0.4588235294117647, 0.670599, 0.184153, 0.366879, 0.4627450980392157, 0.676638, 0.186807, 0.363849, 0.4666666666666667, 0.682656, 0.189501, 0.360757, 0.47058823529411764, 0.688653, 0.192239, 0.357603, 0.4745098039215686, 0.694627, 0.195021, 0.354388, 0.4784313725490196, 0.700576, 0.197851, 0.351113, 0.4823529411764706, 0.7065, 0.200728, 0.347777, 0.48627450980392156, 0.712396, 0.203656, 0.344383, 0.49019607843137253, 0.718264, 0.206636, 0.340931, 0.49411764705882355, 0.724103, 0.20967, 0.337424, 0.4980392156862745, 0.729909, 0.212759, 0.333861, 0.5019607843137255, 0.735683, 0.215906, 0.330245, 0.5058823529411764, 0.741423, 0.219112, 0.326576, 0.5098039215686274, 0.747127, 0.222378, 0.322856, 0.5137254901960784, 0.752794, 0.225706, 0.319085, 0.5176470588235293, 0.758422, 0.229097, 0.315266, 0.5215686274509804, 0.76401, 0.232554, 0.311399, 0.5254901960784314, 0.769556, 0.236077, 0.307485, 0.5294117647058824, 0.775059, 0.239667, 0.303526, 0.5333333333333333, 0.780517, 0.243327, 0.299523, 0.5372549019607843, 0.785929, 0.247056, 0.295477, 0.5411764705882353, 0.791293, 0.250856, 0.29139, 0.5450980392156862, 0.796607, 0.254728, 0.287264, 0.5490196078431373, 0.801871, 0.258674, 0.283099, 0.5529411764705883, 0.807082, 0.262692, 0.278898, 0.5568627450980392, 0.812239, 0.266786, 0.274661, 0.5607843137254902, 0.817341, 0.270954, 0.27039, 0.5647058823529412, 0.822386, 0.275197, 0.266085, 0.5686274509803921, 0.827372, 0.279517, 0.26175, 0.5725490196078431, 0.832299, 0.283913, 0.257383, 0.5764705882352941, 0.837165, 0.288385, 0.252988, 0.580392156862745, 0.841969, 0.292933, 0.248564, 0.5843137254901961, 0.846709, 0.297559, 0.244113, 0.5882352941176471, 0.851384, 0.30226, 0.239636, 0.592156862745098, 0.855992, 0.307038, 0.235133, 0.596078431372549, 0.860533, 0.311892, 0.230606, 0.6, 0.865006, 0.316822, 0.226055, 0.6039215686274509, 0.869409, 0.321827, 0.221482, 0.6078431372549019, 0.873741, 0.326906, 0.216886, 0.611764705882353, 0.878001, 0.33206, 0.212268, 0.615686274509804, 0.882188, 0.337287, 0.207628, 0.6196078431372549, 0.886302, 0.342586, 0.202968, 0.6235294117647059, 0.890341, 0.347957, 0.198286, 0.6274509803921569, 0.894305, 0.353399, 0.193584, 0.6313725490196078, 0.898192, 0.358911, 0.18886, 0.6352941176470588, 0.902003, 0.364492, 0.184116, 0.6392156862745098, 0.905735, 0.37014, 0.17935, 0.6431372549019607, 0.90939, 0.375856, 0.174563, 0.6470588235294118, 0.912966, 0.381636, 0.169755, 0.6509803921568628, 0.916462, 0.387481, 0.164924, 0.6549019607843137, 0.919879, 0.393389, 0.16007, 0.6588235294117647, 0.923215, 0.399359, 0.155193, 0.6627450980392157, 0.92647, 0.405389, 0.150292, 0.6666666666666666, 0.929644, 0.411479, 0.145367, 0.6705882352941176, 0.932737, 0.417627, 0.140417, 0.6745098039215687, 0.935747, 0.423831, 0.13544, 0.6784313725490196, 0.938675, 0.430091, 0.130438, 0.6823529411764706, 0.941521, 0.436405, 0.125409, 0.6862745098039216, 0.944285, 0.442772, 0.120354, 0.6901960784313725, 0.946965, 0.449191, 0.115272, 0.6941176470588235, 0.949562, 0.45566, 0.110164, 0.6980392156862745, 0.952075, 0.462178, 0.105031, 0.7019607843137254, 0.954506, 0.468744, 0.099874, 0.7058823529411764, 0.956852, 0.475356, 0.094695, 0.7098039215686275, 0.959114, 0.482014, 0.089499, 0.7137254901960784, 0.961293, 0.488716, 0.084289, 0.7176470588235294, 0.963387, 0.495462, 0.079073, 0.7215686274509804, 0.965397, 0.502249, 0.073859, 0.7254901960784313, 0.967322, 0.509078, 0.068659, 0.7294117647058823, 0.969163, 0.515946, 0.063488, 0.7333333333333333, 0.970919, 0.522853, 0.058367, 0.7372549019607844, 0.97259, 0.529798, 0.053324, 0.7411764705882353, 0.974176, 0.53678, 0.048392, 0.7450980392156863, 0.975677, 0.543798, 0.043618, 0.7490196078431373, 0.977092, 0.55085, 0.03905, 0.7529411764705882, 0.978422, 0.557937, 0.034931, 0.7568627450980392, 0.979666, 0.565057, 0.031409, 0.7607843137254902, 0.980824, 0.572209, 0.028508, 0.7647058823529411, 0.981895, 0.579392, 0.02625, 0.7686274509803921, 0.982881, 0.586606, 0.024661, 0.7725490196078432, 0.983779, 0.593849, 0.02377, 0.7764705882352941, 0.984591, 0.601122, 0.023606, 0.7803921568627451, 0.985315, 0.608422, 0.024202, 0.7843137254901961, 0.985952, 0.61575, 0.025592, 0.788235294117647, 0.986502, 0.623105, 0.027814, 0.792156862745098, 0.986964, 0.630485, 0.030908, 0.796078431372549, 0.987337, 0.63789, 0.034916, 0.8, 0.987622, 0.64532, 0.039886, 0.803921568627451, 0.987819, 0.652773, 0.045581, 0.807843137254902, 0.987926, 0.66025, 0.05175, 0.8117647058823529, 0.987945, 0.667748, 0.058329, 0.8156862745098039, 0.987874, 0.675267, 0.065257, 0.8196078431372549, 0.987714, 0.682807, 0.072489, 0.8235294117647058, 0.987464, 0.690366, 0.07999, 0.8274509803921568, 0.987124, 0.697944, 0.087731, 0.8313725490196078, 0.986694, 0.70554, 0.095694, 0.8352941176470589, 0.986175, 0.713153, 0.103863, 0.8392156862745098, 0.985566, 0.720782, 0.112229, 0.8431372549019608, 0.984865, 0.728427, 0.120785, 0.8470588235294118, 0.984075, 0.736087, 0.129527, 0.8509803921568627, 0.983196, 0.743758, 0.138453, 0.8549019607843137, 0.982228, 0.751442, 0.147565, 0.8588235294117647, 0.981173, 0.759135, 0.156863, 0.8627450980392157, 0.980032, 0.766837, 0.166353, 0.8666666666666667, 0.978806, 0.774545, 0.176037, 0.8705882352941177, 0.977497, 0.782258, 0.185923, 0.8745098039215686, 0.976108, 0.789974, 0.196018, 0.8784313725490196, 0.974638, 0.797692, 0.206332, 0.8823529411764706, 0.973088, 0.805409, 0.216877, 0.8862745098039215, 0.971468, 0.813122, 0.227658, 0.8901960784313725, 0.969783, 0.820825, 0.238686, 0.8941176470588235, 0.968041, 0.828515, 0.249972, 0.8980392156862745, 0.966243, 0.836191, 0.261534, 0.9019607843137255, 0.964394, 0.843848, 0.273391, 0.9058823529411765, 0.962517, 0.851476, 0.285546, 0.9098039215686274, 0.960626, 0.859069, 0.29801, 0.9137254901960784, 0.95872, 0.866624, 0.31082, 0.9176470588235294, 0.956834, 0.874129, 0.323974, 0.9215686274509803, 0.954997, 0.881569, 0.337475, 0.9254901960784314, 0.953215, 0.888942, 0.351369, 0.9294117647058824, 0.951546, 0.896226, 0.365627, 0.9333333333333333, 0.950018, 0.903409, 0.380271, 0.9372549019607843, 0.948683, 0.910473, 0.395289, 0.9411764705882353, 0.947594, 0.917399, 0.410665, 0.9450980392156862, 0.946809, 0.924168, 0.426373, 0.9490196078431372, 0.946392, 0.930761, 0.442367, 0.9529411764705882, 0.946403, 0.937159, 0.458592, 0.9568627450980391, 0.946903, 0.943348, 0.47497, 0.9607843137254902, 0.947937, 0.949318, 0.491426, 0.9647058823529412, 0.949545, 0.955063, 0.50786, 0.9686274509803922, 0.95174, 0.960587, 0.524203, 0.9725490196078431, 0.954529, 0.965896, 0.540361, 0.9764705882352941, 0.957896, 0.971003, 0.556275, 0.9803921568627451, 0.961812, 0.975924, 0.571925, 0.984313725490196, 0.966249, 0.980678, 0.587206, 0.9882352941176471, 0.971162, 0.985282, 0.602154, 0.9921568627450981, 0.976511, 0.989753, 0.61676, 0.996078431372549, 0.982257, 0.994109, 0.631017, 1.0, 0.988362, 0.998364, 0.644924], color_range=[], name=None, compression_level=0, **kwargs)[source]

Create a Surface drawable.

Plot a 2d function: z = f(x, y).

The default domain of the scalar field is -0.5 < x, y < 0.5.

If the domain should be different, the bounding box needs to be transformed using kwargs, like this:

surface(…, bounds=[-1, 1, -1, 1])

or:

surface(…, xmin=-10, xmax=10, ymin=-4, ymax=4)

Arguments:
heights: array_like.

A 2d scalar function values grid.

color: int.

Packed RGB color of the surface (0xff0000 is red, 0xff is blue).

wireframe: bool.

Whether mesh should display as wireframe.

flat_shading: bool.

Whether mesh should display with flat shading.

attribute: array_like.

Array of float attribute for the color mapping, coresponding to each vertex.

color_map: list.

A list of float quadruplets (attribute value, R, G, B), sorted by attribute value. The first quadruplet should have value 0.0, the last 1.0; R, G, B are RGB color components in the range 0.0 to 1.0.

color_range: list.

A pair [min_value, max_value], which determines the levels of color attribute mapped to 0 and 1 in the color map respectively.

name: string.

A name of a object

kwargs: dict.

Dictionary arguments to configure transform and model_matrix.

k3d.factory.text(text, position=0, 0, 0, color=255, reference_point='lb', on_top=True, size=1.0, label_box=True, is_html=False, name=None, compression_level=0)[source]

Create a Text drawable for 3D-positioned text labels.

Arguments:
text: str.

Content of the text.

position: list.

Coordinates (x, y, z) of the text’s position.

on_top: Boolean.

Render order with 3d object

label_box: Boolean.

Label background box.

color: int.

Packed RGB color of the text (0xff0000 is red, 0xff is blue).

is_html: Boolean.

Whether text should be interpreted as HTML insted of KaTeX.

reference_point: str.

Two-letter string representing the text’s alignment. First letter: ‘l’, ‘c’ or ‘r’: left, center or right

Second letter: ‘t’, ‘c’ or ‘b’: top, center or bottom.

name: string.

A name of a object

size: float.

Font size in ‘em’ HTML units.

k3d.factory.text2d(text, position=0, 0, color=255, size=1.0, reference_point='lt', label_box=True, name=None, is_html=False, compression_level=0)[source]

Create a Text2d drawable for 2D-positioned (viewport bound, OSD) labels.

Arguments:
text: str.

Content of the text.

position: list.

Ratios (r_x, r_y) of the text’s position in range (0, 1) - relative to canvas size.

color: int.

Packed RGB color of the text (0xff0000 is red, 0xff is blue).

is_html: Boolean.

Whether text should be interpreted as HTML insted of KaTeX.

reference_point: str.

Two-letter string representing the text’s alignment.

First letter: ‘l’, ‘c’ or ‘r’: left, center or right

Second letter: ‘t’, ‘c’ or ‘b’: top, center or bottom.

label_box: Boolean.

Label background box.

name: string.

A name of a object

size: float.

Font size in ‘em’ HTML units.

k3d.factory.texture(binary=None, file_format=None, color_map=[0.0, 0.001462, 0.000466, 0.013866, 0.00392156862745098, 0.002267, 0.00127, 0.01857, 0.00784313725490196, 0.003299, 0.002249, 0.024239, 0.011764705882352941, 0.004547, 0.003392, 0.030909, 0.01568627450980392, 0.006006, 0.004692, 0.038558, 0.0196078431372549, 0.007676, 0.006136, 0.046836, 0.023529411764705882, 0.009561, 0.007713, 0.055143, 0.027450980392156862, 0.011663, 0.009417, 0.06346, 0.03137254901960784, 0.013995, 0.011225, 0.071862, 0.03529411764705882, 0.016561, 0.013136, 0.080282, 0.0392156862745098, 0.019373, 0.015133, 0.088767, 0.043137254901960784, 0.022447, 0.017199, 0.097327, 0.047058823529411764, 0.025793, 0.019331, 0.10593, 0.050980392156862744, 0.029432, 0.021503, 0.114621, 0.054901960784313725, 0.033385, 0.023702, 0.123397, 0.058823529411764705, 0.037668, 0.025921, 0.132232, 0.06274509803921569, 0.042253, 0.028139, 0.141141, 0.06666666666666667, 0.046915, 0.030324, 0.150164, 0.07058823529411765, 0.051644, 0.032474, 0.159254, 0.07450980392156863, 0.056449, 0.034569, 0.168414, 0.0784313725490196, 0.06134, 0.03659, 0.177642, 0.08235294117647059, 0.066331, 0.038504, 0.186962, 0.08627450980392157, 0.071429, 0.040294, 0.196354, 0.09019607843137255, 0.076637, 0.041905, 0.205799, 0.09411764705882353, 0.081962, 0.043328, 0.215289, 0.09803921568627451, 0.087411, 0.044556, 0.224813, 0.10196078431372549, 0.09299, 0.045583, 0.234358, 0.10588235294117647, 0.098702, 0.046402, 0.243904, 0.10980392156862745, 0.104551, 0.047008, 0.25343, 0.11372549019607843, 0.110536, 0.047399, 0.262912, 0.11764705882352941, 0.116656, 0.047574, 0.272321, 0.12156862745098039, 0.122908, 0.047536, 0.281624, 0.12549019607843137, 0.129285, 0.047293, 0.290788, 0.12941176470588234, 0.135778, 0.046856, 0.299776, 0.13333333333333333, 0.142378, 0.046242, 0.308553, 0.13725490196078433, 0.149073, 0.045468, 0.317085, 0.1411764705882353, 0.15585, 0.044559, 0.325338, 0.14509803921568626, 0.162689, 0.043554, 0.333277, 0.14901960784313725, 0.169575, 0.042489, 0.340874, 0.15294117647058825, 0.176493, 0.041402, 0.348111, 0.1568627450980392, 0.183429, 0.040329, 0.354971, 0.16078431372549018, 0.190367, 0.039309, 0.361447, 0.16470588235294117, 0.197297, 0.0384, 0.367535, 0.16862745098039217, 0.204209, 0.037632, 0.373238, 0.17254901960784313, 0.211095, 0.03703, 0.378563, 0.1764705882352941, 0.217949, 0.036615, 0.383522, 0.1803921568627451, 0.224763, 0.036405, 0.388129, 0.1843137254901961, 0.231538, 0.036405, 0.3924, 0.18823529411764706, 0.238273, 0.036621, 0.396353, 0.19215686274509802, 0.244967, 0.037055, 0.400007, 0.19607843137254902, 0.25162, 0.037705, 0.403378, 0.2, 0.258234, 0.038571, 0.406485, 0.20392156862745098, 0.26481, 0.039647, 0.409345, 0.20784313725490194, 0.271347, 0.040922, 0.411976, 0.21176470588235294, 0.27785, 0.042353, 0.414392, 0.21568627450980393, 0.284321, 0.043933, 0.416608, 0.2196078431372549, 0.290763, 0.045644, 0.418637, 0.22352941176470587, 0.297178, 0.04747, 0.420491, 0.22745098039215686, 0.303568, 0.049396, 0.422182, 0.23137254901960785, 0.309935, 0.051407, 0.423721, 0.23529411764705882, 0.316282, 0.05349, 0.425116, 0.2392156862745098, 0.32261, 0.055634, 0.426377, 0.24313725490196078, 0.328921, 0.057827, 0.427511, 0.24705882352941178, 0.335217, 0.06006, 0.428524, 0.25098039215686274, 0.3415, 0.062325, 0.429425, 0.2549019607843137, 0.347771, 0.064616, 0.430217, 0.2588235294117647, 0.354032, 0.066925, 0.430906, 0.2627450980392157, 0.360284, 0.069247, 0.431497, 0.26666666666666666, 0.366529, 0.071579, 0.431994, 0.27058823529411763, 0.372768, 0.073915, 0.4324, 0.27450980392156865, 0.379001, 0.076253, 0.432719, 0.2784313725490196, 0.385228, 0.078591, 0.432955, 0.2823529411764706, 0.391453, 0.080927, 0.433109, 0.28627450980392155, 0.397674, 0.083257, 0.433183, 0.2901960784313725, 0.403894, 0.08558, 0.433179, 0.29411764705882354, 0.410113, 0.087896, 0.433098, 0.2980392156862745, 0.416331, 0.090203, 0.432943, 0.30196078431372547, 0.422549, 0.092501, 0.432714, 0.3058823529411765, 0.428768, 0.09479, 0.432412, 0.30980392156862746, 0.434987, 0.097069, 0.432039, 0.3137254901960784, 0.441207, 0.099338, 0.431594, 0.3176470588235294, 0.447428, 0.101597, 0.43108, 0.32156862745098036, 0.453651, 0.103848, 0.430498, 0.3254901960784314, 0.459875, 0.106089, 0.429846, 0.32941176470588235, 0.4661, 0.108322, 0.429125, 0.3333333333333333, 0.472328, 0.110547, 0.428334, 0.33725490196078434, 0.478558, 0.112764, 0.427475, 0.3411764705882353, 0.484789, 0.114974, 0.426548, 0.34509803921568627, 0.491022, 0.117179, 0.425552, 0.34901960784313724, 0.497257, 0.119379, 0.424488, 0.3529411764705882, 0.503493, 0.121575, 0.423356, 0.3568627450980392, 0.50973, 0.123769, 0.422156, 0.3607843137254902, 0.515967, 0.12596, 0.420887, 0.36470588235294116, 0.522206, 0.12815, 0.419549, 0.3686274509803922, 0.528444, 0.130341, 0.418142, 0.37254901960784315, 0.534683, 0.132534, 0.416667, 0.3764705882352941, 0.54092, 0.134729, 0.415123, 0.3803921568627451, 0.547157, 0.136929, 0.413511, 0.38431372549019605, 0.553392, 0.139134, 0.411829, 0.38823529411764707, 0.559624, 0.141346, 0.410078, 0.39215686274509803, 0.565854, 0.143567, 0.408258, 0.396078431372549, 0.572081, 0.145797, 0.406369, 0.4, 0.578304, 0.148039, 0.404411, 0.403921568627451, 0.584521, 0.150294, 0.402385, 0.40784313725490196, 0.590734, 0.152563, 0.40029, 0.4117647058823529, 0.59694, 0.154848, 0.398125, 0.4156862745098039, 0.603139, 0.157151, 0.395891, 0.4196078431372549, 0.60933, 0.159474, 0.393589, 0.4235294117647059, 0.615513, 0.161817, 0.391219, 0.42745098039215684, 0.621685, 0.164184, 0.388781, 0.43137254901960786, 0.627847, 0.166575, 0.386276, 0.43529411764705883, 0.633998, 0.168992, 0.383704, 0.4392156862745098, 0.640135, 0.171438, 0.381065, 0.44313725490196076, 0.64626, 0.173914, 0.378359, 0.44705882352941173, 0.652369, 0.176421, 0.375586, 0.45098039215686275, 0.658463, 0.178962, 0.372748, 0.4549019607843137, 0.66454, 0.181539, 0.369846, 0.4588235294117647, 0.670599, 0.184153, 0.366879, 0.4627450980392157, 0.676638, 0.186807, 0.363849, 0.4666666666666667, 0.682656, 0.189501, 0.360757, 0.47058823529411764, 0.688653, 0.192239, 0.357603, 0.4745098039215686, 0.694627, 0.195021, 0.354388, 0.4784313725490196, 0.700576, 0.197851, 0.351113, 0.4823529411764706, 0.7065, 0.200728, 0.347777, 0.48627450980392156, 0.712396, 0.203656, 0.344383, 0.49019607843137253, 0.718264, 0.206636, 0.340931, 0.49411764705882355, 0.724103, 0.20967, 0.337424, 0.4980392156862745, 0.729909, 0.212759, 0.333861, 0.5019607843137255, 0.735683, 0.215906, 0.330245, 0.5058823529411764, 0.741423, 0.219112, 0.326576, 0.5098039215686274, 0.747127, 0.222378, 0.322856, 0.5137254901960784, 0.752794, 0.225706, 0.319085, 0.5176470588235293, 0.758422, 0.229097, 0.315266, 0.5215686274509804, 0.76401, 0.232554, 0.311399, 0.5254901960784314, 0.769556, 0.236077, 0.307485, 0.5294117647058824, 0.775059, 0.239667, 0.303526, 0.5333333333333333, 0.780517, 0.243327, 0.299523, 0.5372549019607843, 0.785929, 0.247056, 0.295477, 0.5411764705882353, 0.791293, 0.250856, 0.29139, 0.5450980392156862, 0.796607, 0.254728, 0.287264, 0.5490196078431373, 0.801871, 0.258674, 0.283099, 0.5529411764705883, 0.807082, 0.262692, 0.278898, 0.5568627450980392, 0.812239, 0.266786, 0.274661, 0.5607843137254902, 0.817341, 0.270954, 0.27039, 0.5647058823529412, 0.822386, 0.275197, 0.266085, 0.5686274509803921, 0.827372, 0.279517, 0.26175, 0.5725490196078431, 0.832299, 0.283913, 0.257383, 0.5764705882352941, 0.837165, 0.288385, 0.252988, 0.580392156862745, 0.841969, 0.292933, 0.248564, 0.5843137254901961, 0.846709, 0.297559, 0.244113, 0.5882352941176471, 0.851384, 0.30226, 0.239636, 0.592156862745098, 0.855992, 0.307038, 0.235133, 0.596078431372549, 0.860533, 0.311892, 0.230606, 0.6, 0.865006, 0.316822, 0.226055, 0.6039215686274509, 0.869409, 0.321827, 0.221482, 0.6078431372549019, 0.873741, 0.326906, 0.216886, 0.611764705882353, 0.878001, 0.33206, 0.212268, 0.615686274509804, 0.882188, 0.337287, 0.207628, 0.6196078431372549, 0.886302, 0.342586, 0.202968, 0.6235294117647059, 0.890341, 0.347957, 0.198286, 0.6274509803921569, 0.894305, 0.353399, 0.193584, 0.6313725490196078, 0.898192, 0.358911, 0.18886, 0.6352941176470588, 0.902003, 0.364492, 0.184116, 0.6392156862745098, 0.905735, 0.37014, 0.17935, 0.6431372549019607, 0.90939, 0.375856, 0.174563, 0.6470588235294118, 0.912966, 0.381636, 0.169755, 0.6509803921568628, 0.916462, 0.387481, 0.164924, 0.6549019607843137, 0.919879, 0.393389, 0.16007, 0.6588235294117647, 0.923215, 0.399359, 0.155193, 0.6627450980392157, 0.92647, 0.405389, 0.150292, 0.6666666666666666, 0.929644, 0.411479, 0.145367, 0.6705882352941176, 0.932737, 0.417627, 0.140417, 0.6745098039215687, 0.935747, 0.423831, 0.13544, 0.6784313725490196, 0.938675, 0.430091, 0.130438, 0.6823529411764706, 0.941521, 0.436405, 0.125409, 0.6862745098039216, 0.944285, 0.442772, 0.120354, 0.6901960784313725, 0.946965, 0.449191, 0.115272, 0.6941176470588235, 0.949562, 0.45566, 0.110164, 0.6980392156862745, 0.952075, 0.462178, 0.105031, 0.7019607843137254, 0.954506, 0.468744, 0.099874, 0.7058823529411764, 0.956852, 0.475356, 0.094695, 0.7098039215686275, 0.959114, 0.482014, 0.089499, 0.7137254901960784, 0.961293, 0.488716, 0.084289, 0.7176470588235294, 0.963387, 0.495462, 0.079073, 0.7215686274509804, 0.965397, 0.502249, 0.073859, 0.7254901960784313, 0.967322, 0.509078, 0.068659, 0.7294117647058823, 0.969163, 0.515946, 0.063488, 0.7333333333333333, 0.970919, 0.522853, 0.058367, 0.7372549019607844, 0.97259, 0.529798, 0.053324, 0.7411764705882353, 0.974176, 0.53678, 0.048392, 0.7450980392156863, 0.975677, 0.543798, 0.043618, 0.7490196078431373, 0.977092, 0.55085, 0.03905, 0.7529411764705882, 0.978422, 0.557937, 0.034931, 0.7568627450980392, 0.979666, 0.565057, 0.031409, 0.7607843137254902, 0.980824, 0.572209, 0.028508, 0.7647058823529411, 0.981895, 0.579392, 0.02625, 0.7686274509803921, 0.982881, 0.586606, 0.024661, 0.7725490196078432, 0.983779, 0.593849, 0.02377, 0.7764705882352941, 0.984591, 0.601122, 0.023606, 0.7803921568627451, 0.985315, 0.608422, 0.024202, 0.7843137254901961, 0.985952, 0.61575, 0.025592, 0.788235294117647, 0.986502, 0.623105, 0.027814, 0.792156862745098, 0.986964, 0.630485, 0.030908, 0.796078431372549, 0.987337, 0.63789, 0.034916, 0.8, 0.987622, 0.64532, 0.039886, 0.803921568627451, 0.987819, 0.652773, 0.045581, 0.807843137254902, 0.987926, 0.66025, 0.05175, 0.8117647058823529, 0.987945, 0.667748, 0.058329, 0.8156862745098039, 0.987874, 0.675267, 0.065257, 0.8196078431372549, 0.987714, 0.682807, 0.072489, 0.8235294117647058, 0.987464, 0.690366, 0.07999, 0.8274509803921568, 0.987124, 0.697944, 0.087731, 0.8313725490196078, 0.986694, 0.70554, 0.095694, 0.8352941176470589, 0.986175, 0.713153, 0.103863, 0.8392156862745098, 0.985566, 0.720782, 0.112229, 0.8431372549019608, 0.984865, 0.728427, 0.120785, 0.8470588235294118, 0.984075, 0.736087, 0.129527, 0.8509803921568627, 0.983196, 0.743758, 0.138453, 0.8549019607843137, 0.982228, 0.751442, 0.147565, 0.8588235294117647, 0.981173, 0.759135, 0.156863, 0.8627450980392157, 0.980032, 0.766837, 0.166353, 0.8666666666666667, 0.978806, 0.774545, 0.176037, 0.8705882352941177, 0.977497, 0.782258, 0.185923, 0.8745098039215686, 0.976108, 0.789974, 0.196018, 0.8784313725490196, 0.974638, 0.797692, 0.206332, 0.8823529411764706, 0.973088, 0.805409, 0.216877, 0.8862745098039215, 0.971468, 0.813122, 0.227658, 0.8901960784313725, 0.969783, 0.820825, 0.238686, 0.8941176470588235, 0.968041, 0.828515, 0.249972, 0.8980392156862745, 0.966243, 0.836191, 0.261534, 0.9019607843137255, 0.964394, 0.843848, 0.273391, 0.9058823529411765, 0.962517, 0.851476, 0.285546, 0.9098039215686274, 0.960626, 0.859069, 0.29801, 0.9137254901960784, 0.95872, 0.866624, 0.31082, 0.9176470588235294, 0.956834, 0.874129, 0.323974, 0.9215686274509803, 0.954997, 0.881569, 0.337475, 0.9254901960784314, 0.953215, 0.888942, 0.351369, 0.9294117647058824, 0.951546, 0.896226, 0.365627, 0.9333333333333333, 0.950018, 0.903409, 0.380271, 0.9372549019607843, 0.948683, 0.910473, 0.395289, 0.9411764705882353, 0.947594, 0.917399, 0.410665, 0.9450980392156862, 0.946809, 0.924168, 0.426373, 0.9490196078431372, 0.946392, 0.930761, 0.442367, 0.9529411764705882, 0.946403, 0.937159, 0.458592, 0.9568627450980391, 0.946903, 0.943348, 0.47497, 0.9607843137254902, 0.947937, 0.949318, 0.491426, 0.9647058823529412, 0.949545, 0.955063, 0.50786, 0.9686274509803922, 0.95174, 0.960587, 0.524203, 0.9725490196078431, 0.954529, 0.965896, 0.540361, 0.9764705882352941, 0.957896, 0.971003, 0.556275, 0.9803921568627451, 0.961812, 0.975924, 0.571925, 0.984313725490196, 0.966249, 0.980678, 0.587206, 0.9882352941176471, 0.971162, 0.985282, 0.602154, 0.9921568627450981, 0.976511, 0.989753, 0.61676, 0.996078431372549, 0.982257, 0.994109, 0.631017, 1.0, 0.988362, 0.998364, 0.644924], color_range=[], attribute=[], puv=[], opacity_function=[], interpolation=True, name=None, compression_level=0, **kwargs)[source]

Create a Texture drawable for displaying 2D raster images in common formats.

By default, the texture image is mapped into the square: -0.5 < x, y < 0.5, z = 1. If the size (scale, aspect ratio) or position should be different then the texture should be transformed using kwargs, for example:

texture(…, xmin=0, xmax=640, ymin=0, ymax=480)

or:

texture(…, bounds=[0, 10, 0, 20])

or:

texture(…, scaling=[1.0, 0.75, 0])

Arguments:
binary: bytes.

Image data in a specific format.

file_format: str.

Format of the data, it should be the second part of MIME format of type ‘image/’, for example ‘jpeg’, ‘png’, ‘gif’, ‘tiff’.

attribute: array_like.

Array of float attribute for the color mapping, corresponding to each pixels.

color_map: list.

A list of float quadruplets (attribute value, R, G, B), sorted by attribute value. The first quadruplet should have value 0.0, the last 1.0; R, G, B are RGB color components in the range 0.0 to 1.0.

opacity_function: array.

A list of float tuples (attribute value, opacity), sorted by attribute value. The first typles should have value 0.0, the last 1.0; opacity is in the range 0.0 to 1.0.

color_range: list.

A pair [min_value, max_value], which determines the levels of color attribute mapped to 0 and 1 in the color map respectively.

interpolation: bool.

Whether data should be interpolatedor not.

name: string.

A name of a object

puv: list.

A list of float triplets (x,y,z). The first triplet mean a position of left-bottom corner of texture. Second and third triplets means a base of coordinate system for texture.

kwargs: dict.

Dictionary arguments to configure transform and model_matrix.

k3d.factory.texture_text(text, position=0, 0, 0, color=255, font_weight=400, font_face='Courier New', font_size=68, size=1.0, name=None, compression_level=0)[source]

Create a TextureText drawable.

Compared to Text and Text2d this drawable has less features (no KaTeX support), but the labels are located in the GPU memory, and not the browser’s DOM tree. This has performance consequences, and may be preferable when many simple labels need to be displayed.

Arguments:
text: str.

Content of the text.

position: list.

Coordinates (x, y, z) of the text’s position.

color: int.

Packed RGB color of the text (0xff0000 is red, 0xff is blue).

size: float.

Size of the texture sprite containing the text.

font_face: str.

Name of the font to use for rendering the text.

font_weight: int.

Thickness of the characters in HTML-like units from the range (100, 900), where 400 is normal and 600 is bold font.

name: string.

A name of a object

font_size: int.

The font size inside the sprite texture in px units. This does not affect the size of the text in the scene, only the accuracy and raster size of the texture.

k3d.factory.vector_field(vectors, colors=[], origin_color=None, head_color=None, color=255, use_head=True, head_size=1.0, scale=1.0, line_width=0.01, name=None, compression_level=0, **kwargs)[source]

Create a VectorField drawable for displaying dense 2D or 3D grids of vectors of same dimensionality.

By default, the origins of the vectors are assumed to be a grid inscribed in the -0.5 < x, y, z < 0.5 cube or -0.5 < x, y < 0.5 square, regardless of the passed vector field shape (aspect ratio etc.). Different grid size, shape and rotation can be obtained using kwargs:

vector_field(…, bounds=[-pi, pi, -pi, pi, 0, 1])

or:

vector_field(…, scaling=[scale_x, scale_y, scale_z]).

For sparse (i.e. not forming a grid) 3D vectors, use the vectors() function.

Arguments:
vectors: array_like.

Vector field of shape (L, H, W, 3) for 3D fields or (H, W, 2) for 2D fields.

colors: array_like.

Twice the length of vectors array of int: packed RGB colors (0xff0000 is red, 0xff is blue). The array has consecutive pairs (origin_color, head_color) for vectors in row-major order.

origin_color: int.

Packed RGB color of the origins (0xff0000 is red, 0xff is blue), default: same as color.

head_color: int.

Packed RGB color of the vector heads (0xff0000 is red, 0xff is blue), default: same as color.

color: int.

Packed RGB color of the vectors (0xff0000 is red, 0xff is blue) when colors is empty and origin_color and head_color are not specified.

use_head: bool.

Whether vectors should display an arrow head.

head_size: float.

The size of the arrow heads.

scale: float.

Scale factor for the vector lengths, for artificially scaling the vectors in place.

line_width: float.

Width of the vector segments.

name: string.

A name of a object

kwargs: dict.

Dictionary arguments to configure transform and model_matrix.

k3d.factory.vectors(origins, vectors=None, colors=[], origin_color=None, head_color=None, color=255, use_head=True, head_size=1.0, labels=[], label_size=1.0, line_width=0.01, name=None, compression_level=0, **kwargs)[source]

Create a Vectors drawable representing individual 3D vectors.

The color of the vectors is a gradient from origin_color to head_color. Heads, when used, have uniform head_color.

For dense (i.e. forming a grid) 3D or 2D vectors, use the vector_field function.

Arguments:
origins: array_like.

Array of (x, y, z) coordinates of vector origins, when vectors is None, these are (dx, dy, dz) components of unbound vectors (which are displayed as originating in (0, 0, 0)).

vectors: array_like.

The vectors as (dx, dy, dz) float triples. When not given, the origins are taken as vectors. When given, it must be same size as origins.

colors: array_like.

Twice the length of vectors array of int: packed RGB colors (0xff0000 is red, 0xff is blue). The array has consecutive pairs (origin_color, head_color) for vectors in row-major order.

origin_color: int.

Packed RGB color of the origins (0xff0000 is red, 0xff is blue), default: same as color.

head_color: int.

Packed RGB color of the vector heads (0xff0000 is red, 0xff is blue), default: same as color.

color: int.

Packed RGB color of the vectors (0xff0000 is red, 0xff is blue) when colors is empty and origin_color and head_color are not specified.

use_head: bool.

Whether vectors should display an arrow head.

head_size: float.

The size of the arrow heads.

labels: list of str.

Captions to display next to the vectors.

label_size: float.

Label font size in ‘em’ HTML units.

line_width: float.

Width of the vector segments.

name: string.

A name of a object

kwargs: dict.

Dictionary arguments to configure transform and model_matrix.

k3d.factory.volume(volume, color_map=[0.0, 0.001462, 0.000466, 0.013866, 0.00392156862745098, 0.002267, 0.00127, 0.01857, 0.00784313725490196, 0.003299, 0.002249, 0.024239, 0.011764705882352941, 0.004547, 0.003392, 0.030909, 0.01568627450980392, 0.006006, 0.004692, 0.038558, 0.0196078431372549, 0.007676, 0.006136, 0.046836, 0.023529411764705882, 0.009561, 0.007713, 0.055143, 0.027450980392156862, 0.011663, 0.009417, 0.06346, 0.03137254901960784, 0.013995, 0.011225, 0.071862, 0.03529411764705882, 0.016561, 0.013136, 0.080282, 0.0392156862745098, 0.019373, 0.015133, 0.088767, 0.043137254901960784, 0.022447, 0.017199, 0.097327, 0.047058823529411764, 0.025793, 0.019331, 0.10593, 0.050980392156862744, 0.029432, 0.021503, 0.114621, 0.054901960784313725, 0.033385, 0.023702, 0.123397, 0.058823529411764705, 0.037668, 0.025921, 0.132232, 0.06274509803921569, 0.042253, 0.028139, 0.141141, 0.06666666666666667, 0.046915, 0.030324, 0.150164, 0.07058823529411765, 0.051644, 0.032474, 0.159254, 0.07450980392156863, 0.056449, 0.034569, 0.168414, 0.0784313725490196, 0.06134, 0.03659, 0.177642, 0.08235294117647059, 0.066331, 0.038504, 0.186962, 0.08627450980392157, 0.071429, 0.040294, 0.196354, 0.09019607843137255, 0.076637, 0.041905, 0.205799, 0.09411764705882353, 0.081962, 0.043328, 0.215289, 0.09803921568627451, 0.087411, 0.044556, 0.224813, 0.10196078431372549, 0.09299, 0.045583, 0.234358, 0.10588235294117647, 0.098702, 0.046402, 0.243904, 0.10980392156862745, 0.104551, 0.047008, 0.25343, 0.11372549019607843, 0.110536, 0.047399, 0.262912, 0.11764705882352941, 0.116656, 0.047574, 0.272321, 0.12156862745098039, 0.122908, 0.047536, 0.281624, 0.12549019607843137, 0.129285, 0.047293, 0.290788, 0.12941176470588234, 0.135778, 0.046856, 0.299776, 0.13333333333333333, 0.142378, 0.046242, 0.308553, 0.13725490196078433, 0.149073, 0.045468, 0.317085, 0.1411764705882353, 0.15585, 0.044559, 0.325338, 0.14509803921568626, 0.162689, 0.043554, 0.333277, 0.14901960784313725, 0.169575, 0.042489, 0.340874, 0.15294117647058825, 0.176493, 0.041402, 0.348111, 0.1568627450980392, 0.183429, 0.040329, 0.354971, 0.16078431372549018, 0.190367, 0.039309, 0.361447, 0.16470588235294117, 0.197297, 0.0384, 0.367535, 0.16862745098039217, 0.204209, 0.037632, 0.373238, 0.17254901960784313, 0.211095, 0.03703, 0.378563, 0.1764705882352941, 0.217949, 0.036615, 0.383522, 0.1803921568627451, 0.224763, 0.036405, 0.388129, 0.1843137254901961, 0.231538, 0.036405, 0.3924, 0.18823529411764706, 0.238273, 0.036621, 0.396353, 0.19215686274509802, 0.244967, 0.037055, 0.400007, 0.19607843137254902, 0.25162, 0.037705, 0.403378, 0.2, 0.258234, 0.038571, 0.406485, 0.20392156862745098, 0.26481, 0.039647, 0.409345, 0.20784313725490194, 0.271347, 0.040922, 0.411976, 0.21176470588235294, 0.27785, 0.042353, 0.414392, 0.21568627450980393, 0.284321, 0.043933, 0.416608, 0.2196078431372549, 0.290763, 0.045644, 0.418637, 0.22352941176470587, 0.297178, 0.04747, 0.420491, 0.22745098039215686, 0.303568, 0.049396, 0.422182, 0.23137254901960785, 0.309935, 0.051407, 0.423721, 0.23529411764705882, 0.316282, 0.05349, 0.425116, 0.2392156862745098, 0.32261, 0.055634, 0.426377, 0.24313725490196078, 0.328921, 0.057827, 0.427511, 0.24705882352941178, 0.335217, 0.06006, 0.428524, 0.25098039215686274, 0.3415, 0.062325, 0.429425, 0.2549019607843137, 0.347771, 0.064616, 0.430217, 0.2588235294117647, 0.354032, 0.066925, 0.430906, 0.2627450980392157, 0.360284, 0.069247, 0.431497, 0.26666666666666666, 0.366529, 0.071579, 0.431994, 0.27058823529411763, 0.372768, 0.073915, 0.4324, 0.27450980392156865, 0.379001, 0.076253, 0.432719, 0.2784313725490196, 0.385228, 0.078591, 0.432955, 0.2823529411764706, 0.391453, 0.080927, 0.433109, 0.28627450980392155, 0.397674, 0.083257, 0.433183, 0.2901960784313725, 0.403894, 0.08558, 0.433179, 0.29411764705882354, 0.410113, 0.087896, 0.433098, 0.2980392156862745, 0.416331, 0.090203, 0.432943, 0.30196078431372547, 0.422549, 0.092501, 0.432714, 0.3058823529411765, 0.428768, 0.09479, 0.432412, 0.30980392156862746, 0.434987, 0.097069, 0.432039, 0.3137254901960784, 0.441207, 0.099338, 0.431594, 0.3176470588235294, 0.447428, 0.101597, 0.43108, 0.32156862745098036, 0.453651, 0.103848, 0.430498, 0.3254901960784314, 0.459875, 0.106089, 0.429846, 0.32941176470588235, 0.4661, 0.108322, 0.429125, 0.3333333333333333, 0.472328, 0.110547, 0.428334, 0.33725490196078434, 0.478558, 0.112764, 0.427475, 0.3411764705882353, 0.484789, 0.114974, 0.426548, 0.34509803921568627, 0.491022, 0.117179, 0.425552, 0.34901960784313724, 0.497257, 0.119379, 0.424488, 0.3529411764705882, 0.503493, 0.121575, 0.423356, 0.3568627450980392, 0.50973, 0.123769, 0.422156, 0.3607843137254902, 0.515967, 0.12596, 0.420887, 0.36470588235294116, 0.522206, 0.12815, 0.419549, 0.3686274509803922, 0.528444, 0.130341, 0.418142, 0.37254901960784315, 0.534683, 0.132534, 0.416667, 0.3764705882352941, 0.54092, 0.134729, 0.415123, 0.3803921568627451, 0.547157, 0.136929, 0.413511, 0.38431372549019605, 0.553392, 0.139134, 0.411829, 0.38823529411764707, 0.559624, 0.141346, 0.410078, 0.39215686274509803, 0.565854, 0.143567, 0.408258, 0.396078431372549, 0.572081, 0.145797, 0.406369, 0.4, 0.578304, 0.148039, 0.404411, 0.403921568627451, 0.584521, 0.150294, 0.402385, 0.40784313725490196, 0.590734, 0.152563, 0.40029, 0.4117647058823529, 0.59694, 0.154848, 0.398125, 0.4156862745098039, 0.603139, 0.157151, 0.395891, 0.4196078431372549, 0.60933, 0.159474, 0.393589, 0.4235294117647059, 0.615513, 0.161817, 0.391219, 0.42745098039215684, 0.621685, 0.164184, 0.388781, 0.43137254901960786, 0.627847, 0.166575, 0.386276, 0.43529411764705883, 0.633998, 0.168992, 0.383704, 0.4392156862745098, 0.640135, 0.171438, 0.381065, 0.44313725490196076, 0.64626, 0.173914, 0.378359, 0.44705882352941173, 0.652369, 0.176421, 0.375586, 0.45098039215686275, 0.658463, 0.178962, 0.372748, 0.4549019607843137, 0.66454, 0.181539, 0.369846, 0.4588235294117647, 0.670599, 0.184153, 0.366879, 0.4627450980392157, 0.676638, 0.186807, 0.363849, 0.4666666666666667, 0.682656, 0.189501, 0.360757, 0.47058823529411764, 0.688653, 0.192239, 0.357603, 0.4745098039215686, 0.694627, 0.195021, 0.354388, 0.4784313725490196, 0.700576, 0.197851, 0.351113, 0.4823529411764706, 0.7065, 0.200728, 0.347777, 0.48627450980392156, 0.712396, 0.203656, 0.344383, 0.49019607843137253, 0.718264, 0.206636, 0.340931, 0.49411764705882355, 0.724103, 0.20967, 0.337424, 0.4980392156862745, 0.729909, 0.212759, 0.333861, 0.5019607843137255, 0.735683, 0.215906, 0.330245, 0.5058823529411764, 0.741423, 0.219112, 0.326576, 0.5098039215686274, 0.747127, 0.222378, 0.322856, 0.5137254901960784, 0.752794, 0.225706, 0.319085, 0.5176470588235293, 0.758422, 0.229097, 0.315266, 0.5215686274509804, 0.76401, 0.232554, 0.311399, 0.5254901960784314, 0.769556, 0.236077, 0.307485, 0.5294117647058824, 0.775059, 0.239667, 0.303526, 0.5333333333333333, 0.780517, 0.243327, 0.299523, 0.5372549019607843, 0.785929, 0.247056, 0.295477, 0.5411764705882353, 0.791293, 0.250856, 0.29139, 0.5450980392156862, 0.796607, 0.254728, 0.287264, 0.5490196078431373, 0.801871, 0.258674, 0.283099, 0.5529411764705883, 0.807082, 0.262692, 0.278898, 0.5568627450980392, 0.812239, 0.266786, 0.274661, 0.5607843137254902, 0.817341, 0.270954, 0.27039, 0.5647058823529412, 0.822386, 0.275197, 0.266085, 0.5686274509803921, 0.827372, 0.279517, 0.26175, 0.5725490196078431, 0.832299, 0.283913, 0.257383, 0.5764705882352941, 0.837165, 0.288385, 0.252988, 0.580392156862745, 0.841969, 0.292933, 0.248564, 0.5843137254901961, 0.846709, 0.297559, 0.244113, 0.5882352941176471, 0.851384, 0.30226, 0.239636, 0.592156862745098, 0.855992, 0.307038, 0.235133, 0.596078431372549, 0.860533, 0.311892, 0.230606, 0.6, 0.865006, 0.316822, 0.226055, 0.6039215686274509, 0.869409, 0.321827, 0.221482, 0.6078431372549019, 0.873741, 0.326906, 0.216886, 0.611764705882353, 0.878001, 0.33206, 0.212268, 0.615686274509804, 0.882188, 0.337287, 0.207628, 0.6196078431372549, 0.886302, 0.342586, 0.202968, 0.6235294117647059, 0.890341, 0.347957, 0.198286, 0.6274509803921569, 0.894305, 0.353399, 0.193584, 0.6313725490196078, 0.898192, 0.358911, 0.18886, 0.6352941176470588, 0.902003, 0.364492, 0.184116, 0.6392156862745098, 0.905735, 0.37014, 0.17935, 0.6431372549019607, 0.90939, 0.375856, 0.174563, 0.6470588235294118, 0.912966, 0.381636, 0.169755, 0.6509803921568628, 0.916462, 0.387481, 0.164924, 0.6549019607843137, 0.919879, 0.393389, 0.16007, 0.6588235294117647, 0.923215, 0.399359, 0.155193, 0.6627450980392157, 0.92647, 0.405389, 0.150292, 0.6666666666666666, 0.929644, 0.411479, 0.145367, 0.6705882352941176, 0.932737, 0.417627, 0.140417, 0.6745098039215687, 0.935747, 0.423831, 0.13544, 0.6784313725490196, 0.938675, 0.430091, 0.130438, 0.6823529411764706, 0.941521, 0.436405, 0.125409, 0.6862745098039216, 0.944285, 0.442772, 0.120354, 0.6901960784313725, 0.946965, 0.449191, 0.115272, 0.6941176470588235, 0.949562, 0.45566, 0.110164, 0.6980392156862745, 0.952075, 0.462178, 0.105031, 0.7019607843137254, 0.954506, 0.468744, 0.099874, 0.7058823529411764, 0.956852, 0.475356, 0.094695, 0.7098039215686275, 0.959114, 0.482014, 0.089499, 0.7137254901960784, 0.961293, 0.488716, 0.084289, 0.7176470588235294, 0.963387, 0.495462, 0.079073, 0.7215686274509804, 0.965397, 0.502249, 0.073859, 0.7254901960784313, 0.967322, 0.509078, 0.068659, 0.7294117647058823, 0.969163, 0.515946, 0.063488, 0.7333333333333333, 0.970919, 0.522853, 0.058367, 0.7372549019607844, 0.97259, 0.529798, 0.053324, 0.7411764705882353, 0.974176, 0.53678, 0.048392, 0.7450980392156863, 0.975677, 0.543798, 0.043618, 0.7490196078431373, 0.977092, 0.55085, 0.03905, 0.7529411764705882, 0.978422, 0.557937, 0.034931, 0.7568627450980392, 0.979666, 0.565057, 0.031409, 0.7607843137254902, 0.980824, 0.572209, 0.028508, 0.7647058823529411, 0.981895, 0.579392, 0.02625, 0.7686274509803921, 0.982881, 0.586606, 0.024661, 0.7725490196078432, 0.983779, 0.593849, 0.02377, 0.7764705882352941, 0.984591, 0.601122, 0.023606, 0.7803921568627451, 0.985315, 0.608422, 0.024202, 0.7843137254901961, 0.985952, 0.61575, 0.025592, 0.788235294117647, 0.986502, 0.623105, 0.027814, 0.792156862745098, 0.986964, 0.630485, 0.030908, 0.796078431372549, 0.987337, 0.63789, 0.034916, 0.8, 0.987622, 0.64532, 0.039886, 0.803921568627451, 0.987819, 0.652773, 0.045581, 0.807843137254902, 0.987926, 0.66025, 0.05175, 0.8117647058823529, 0.987945, 0.667748, 0.058329, 0.8156862745098039, 0.987874, 0.675267, 0.065257, 0.8196078431372549, 0.987714, 0.682807, 0.072489, 0.8235294117647058, 0.987464, 0.690366, 0.07999, 0.8274509803921568, 0.987124, 0.697944, 0.087731, 0.8313725490196078, 0.986694, 0.70554, 0.095694, 0.8352941176470589, 0.986175, 0.713153, 0.103863, 0.8392156862745098, 0.985566, 0.720782, 0.112229, 0.8431372549019608, 0.984865, 0.728427, 0.120785, 0.8470588235294118, 0.984075, 0.736087, 0.129527, 0.8509803921568627, 0.983196, 0.743758, 0.138453, 0.8549019607843137, 0.982228, 0.751442, 0.147565, 0.8588235294117647, 0.981173, 0.759135, 0.156863, 0.8627450980392157, 0.980032, 0.766837, 0.166353, 0.8666666666666667, 0.978806, 0.774545, 0.176037, 0.8705882352941177, 0.977497, 0.782258, 0.185923, 0.8745098039215686, 0.976108, 0.789974, 0.196018, 0.8784313725490196, 0.974638, 0.797692, 0.206332, 0.8823529411764706, 0.973088, 0.805409, 0.216877, 0.8862745098039215, 0.971468, 0.813122, 0.227658, 0.8901960784313725, 0.969783, 0.820825, 0.238686, 0.8941176470588235, 0.968041, 0.828515, 0.249972, 0.8980392156862745, 0.966243, 0.836191, 0.261534, 0.9019607843137255, 0.964394, 0.843848, 0.273391, 0.9058823529411765, 0.962517, 0.851476, 0.285546, 0.9098039215686274, 0.960626, 0.859069, 0.29801, 0.9137254901960784, 0.95872, 0.866624, 0.31082, 0.9176470588235294, 0.956834, 0.874129, 0.323974, 0.9215686274509803, 0.954997, 0.881569, 0.337475, 0.9254901960784314, 0.953215, 0.888942, 0.351369, 0.9294117647058824, 0.951546, 0.896226, 0.365627, 0.9333333333333333, 0.950018, 0.903409, 0.380271, 0.9372549019607843, 0.948683, 0.910473, 0.395289, 0.9411764705882353, 0.947594, 0.917399, 0.410665, 0.9450980392156862, 0.946809, 0.924168, 0.426373, 0.9490196078431372, 0.946392, 0.930761, 0.442367, 0.9529411764705882, 0.946403, 0.937159, 0.458592, 0.9568627450980391, 0.946903, 0.943348, 0.47497, 0.9607843137254902, 0.947937, 0.949318, 0.491426, 0.9647058823529412, 0.949545, 0.955063, 0.50786, 0.9686274509803922, 0.95174, 0.960587, 0.524203, 0.9725490196078431, 0.954529, 0.965896, 0.540361, 0.9764705882352941, 0.957896, 0.971003, 0.556275, 0.9803921568627451, 0.961812, 0.975924, 0.571925, 0.984313725490196, 0.966249, 0.980678, 0.587206, 0.9882352941176471, 0.971162, 0.985282, 0.602154, 0.9921568627450981, 0.976511, 0.989753, 0.61676, 0.996078431372549, 0.982257, 0.994109, 0.631017, 1.0, 0.988362, 0.998364, 0.644924], opacity_function=None, color_range=[], samples=512.0, alpha_coef=50.0, gradient_step=0.005, shadow='off', interpolation=True, shadow_delay=500, shadow_res=128, focal_length=0.0, focal_plane=100.0, ray_samples_count=16, name=None, compression_level=0, **kwargs)[source]

Create a Volume drawable for 3D volumetric data.

By default, the volume are a grid inscribed in the -0.5 < x, y, z < 0.5 cube regardless of the passed voxel array shape (aspect ratio etc.). Different grid size, shape and rotation can be obtained using kwargs:

volume(…, bounds=[0, 300, 0, 400, 0, 500])

or:

volume(…, scaling=[scale_x, scale_y, scale_z]).

Arguments:
volume: array_like.

3D array of float

color_map: list.

A list of float quadruplets (attribute value, R, G, B), sorted by attribute value. The first quadruplet should have value 0.0, the last 1.0; R, G, B are RGB color components in the range 0.0 to 1.0.

opacity_function: array.

A list of float tuples (attribute value, opacity), sorted by attribute value. The first typles should have value 0.0, the last 1.0; opacity is in the range 0.0 to 1.0.

color_range: list.

A pair [min_value, max_value], which determines the levels of volume attribute mapped to 0 and 1 in the color map respectively.

samples: float.

Number of iteration per 1 unit of space.

alpha_coef: float

Alpha multiplier.

gradient_step: float

Gradient light step.

focal_length: float

focal length of depth of field renderer. 0.0 for disabled

focal_plane: float

focal plane for depth of field renderer

ray_samples_count: Int

Number of rays for Depth of Field rendering

shadow: str.

Type of shadow on volume Legal values are:

off

shadow disabled,

on_demand

update shadow map on demand,

dynamic

update shadow map automaticaly every shadow_delay.

shadow_delay: float.

Minimum number of miliseconds between shadow map updates.

shadow_res: int.

Resolution of shadow map.

interpolation: bool.

Whether volume raycasting should interpolate data or not.

name: string.

A name of a object

kwargs: dict.

Dictionary arguments to configure transform and model_matrix.

k3d.factory.voxel_chunk(voxels, coord, multiple=1, compression_level=0)[source]

Create a chunk of data that can be used for k3d.voxels_group.

Arguments:
voxels: array_like.

3D array of int in range (0, 255). 0 means empty voxel, 1 and above refer to consecutive color_map entries.

coord: array_like.

Coordinate of chunk

multiple: Int

For future usage

k3d.factory.voxels(voxels, color_map=15079755, 3978315, 16769305, 33480, 16089649, 9510580, 4649200, 15741670, 13825340, 16432830, 32896, 15122175, 11169320, 16775880, 8388608, 11206595, 8421376, 16767153, 128, 8421504, 16777215, 0, wireframe=False, outlines=True, outlines_color=0, opacity=1.0, name=None, compression_level=0, bounds=None, **kwargs)[source]

Create a Voxels drawable for 3D volumetric data.

By default, the voxels are a grid inscribed in the -0.5 < x, y, z < 0.5 cube regardless of the passed voxel array shape (aspect ratio etc.). Different grid size, shape and rotation can be obtained using kwargs:

voxels(…, bounds=[0, 300, 0, 400, 0, 500])

or:

voxels(…, scaling=[scale_x, scale_y, scale_z]).

Arguments:
voxels: array_like.

3D array of int in range (0, 255). 0 means empty voxel, 1 and above refer to consecutive color_map entries.

color_map: array_like.

Flat array of int packed RGB colors (0xff0000 is red, 0xff is blue). The color defined at index i is for voxel value (i+1), e.g.:

color_map = [0xff, 0x00ff]
voxels =
[
0, # empty voxel
1, # blue voxel
2 # red voxel
]
wireframe: bool.

Whether mesh should display as wireframe.

opacity: float.

Opacity of voxels.

outlines: bool.

Whether mesh should display with outlines.

outlines_color: int.

Packed RGB color of the resulting outlines (0xff0000 is red, 0xff is blue)

name: string.

A name of a object

kwargs: dict.

Dictionary arguments to configure transform and model_matrix.

k3d.factory.voxels_group(space_size, voxels_group=[], chunks_ids=[], color_map=15079755, 3978315, 16769305, 33480, 16089649, 9510580, 4649200, 15741670, 13825340, 16432830, 32896, 15122175, 11169320, 16775880, 8388608, 11206595, 8421376, 16767153, 128, 8421504, 16777215, 0, wireframe=False, outlines=True, outlines_color=0, opacity=1.0, name=None, compression_level=0, **kwargs)[source]

Create a Voxels drawable for 3D volumetric data.

By default, the voxels are a grid inscribed in the -0.5 < x, y, z < 0.5 cube regardless of the passed voxel array shape (aspect ratio etc.). Different grid size, shape and rotation can be obtained using kwargs:

voxels(…, bounds=[0, 300, 0, 400, 0, 500])

or:

voxels(…, scaling=[scale_x, scale_y, scale_z]).

Arguments:
space_size: array_like.

Width, Height, Length of space

voxels_group: array_like.

List of chunks in format {voxels: np.array, coord: [x,y,z], multiple: number}.

chunks_ids: array.

List of chunks_id. Chunks widget you can create using k3d.voxel_chunk()

color_map: array_like.

Flat array of int packed RGB colors (0xff0000 is red, 0xff is blue).

wireframe: bool.

Whether mesh should display as wireframe.

opacity: float.

Opacity of voxels.

outlines: bool.

Whether mesh should display with outlines.

outlines_color: int.

Packed RGB color of the resulting outlines (0xff0000 is red, 0xff is blue)

name: string.

A name of a object

kwargs: dict.

Dictionary arguments to configure transform and model_matrix.

k3d.factory.vtk_poly_data(poly_data, color=255, color_attribute=None, color_map=[0.0, 0.001462, 0.000466, 0.013866, 0.00392156862745098, 0.002267, 0.00127, 0.01857, 0.00784313725490196, 0.003299, 0.002249, 0.024239, 0.011764705882352941, 0.004547, 0.003392, 0.030909, 0.01568627450980392, 0.006006, 0.004692, 0.038558, 0.0196078431372549, 0.007676, 0.006136, 0.046836, 0.023529411764705882, 0.009561, 0.007713, 0.055143, 0.027450980392156862, 0.011663, 0.009417, 0.06346, 0.03137254901960784, 0.013995, 0.011225, 0.071862, 0.03529411764705882, 0.016561, 0.013136, 0.080282, 0.0392156862745098, 0.019373, 0.015133, 0.088767, 0.043137254901960784, 0.022447, 0.017199, 0.097327, 0.047058823529411764, 0.025793, 0.019331, 0.10593, 0.050980392156862744, 0.029432, 0.021503, 0.114621, 0.054901960784313725, 0.033385, 0.023702, 0.123397, 0.058823529411764705, 0.037668, 0.025921, 0.132232, 0.06274509803921569, 0.042253, 0.028139, 0.141141, 0.06666666666666667, 0.046915, 0.030324, 0.150164, 0.07058823529411765, 0.051644, 0.032474, 0.159254, 0.07450980392156863, 0.056449, 0.034569, 0.168414, 0.0784313725490196, 0.06134, 0.03659, 0.177642, 0.08235294117647059, 0.066331, 0.038504, 0.186962, 0.08627450980392157, 0.071429, 0.040294, 0.196354, 0.09019607843137255, 0.076637, 0.041905, 0.205799, 0.09411764705882353, 0.081962, 0.043328, 0.215289, 0.09803921568627451, 0.087411, 0.044556, 0.224813, 0.10196078431372549, 0.09299, 0.045583, 0.234358, 0.10588235294117647, 0.098702, 0.046402, 0.243904, 0.10980392156862745, 0.104551, 0.047008, 0.25343, 0.11372549019607843, 0.110536, 0.047399, 0.262912, 0.11764705882352941, 0.116656, 0.047574, 0.272321, 0.12156862745098039, 0.122908, 0.047536, 0.281624, 0.12549019607843137, 0.129285, 0.047293, 0.290788, 0.12941176470588234, 0.135778, 0.046856, 0.299776, 0.13333333333333333, 0.142378, 0.046242, 0.308553, 0.13725490196078433, 0.149073, 0.045468, 0.317085, 0.1411764705882353, 0.15585, 0.044559, 0.325338, 0.14509803921568626, 0.162689, 0.043554, 0.333277, 0.14901960784313725, 0.169575, 0.042489, 0.340874, 0.15294117647058825, 0.176493, 0.041402, 0.348111, 0.1568627450980392, 0.183429, 0.040329, 0.354971, 0.16078431372549018, 0.190367, 0.039309, 0.361447, 0.16470588235294117, 0.197297, 0.0384, 0.367535, 0.16862745098039217, 0.204209, 0.037632, 0.373238, 0.17254901960784313, 0.211095, 0.03703, 0.378563, 0.1764705882352941, 0.217949, 0.036615, 0.383522, 0.1803921568627451, 0.224763, 0.036405, 0.388129, 0.1843137254901961, 0.231538, 0.036405, 0.3924, 0.18823529411764706, 0.238273, 0.036621, 0.396353, 0.19215686274509802, 0.244967, 0.037055, 0.400007, 0.19607843137254902, 0.25162, 0.037705, 0.403378, 0.2, 0.258234, 0.038571, 0.406485, 0.20392156862745098, 0.26481, 0.039647, 0.409345, 0.20784313725490194, 0.271347, 0.040922, 0.411976, 0.21176470588235294, 0.27785, 0.042353, 0.414392, 0.21568627450980393, 0.284321, 0.043933, 0.416608, 0.2196078431372549, 0.290763, 0.045644, 0.418637, 0.22352941176470587, 0.297178, 0.04747, 0.420491, 0.22745098039215686, 0.303568, 0.049396, 0.422182, 0.23137254901960785, 0.309935, 0.051407, 0.423721, 0.23529411764705882, 0.316282, 0.05349, 0.425116, 0.2392156862745098, 0.32261, 0.055634, 0.426377, 0.24313725490196078, 0.328921, 0.057827, 0.427511, 0.24705882352941178, 0.335217, 0.06006, 0.428524, 0.25098039215686274, 0.3415, 0.062325, 0.429425, 0.2549019607843137, 0.347771, 0.064616, 0.430217, 0.2588235294117647, 0.354032, 0.066925, 0.430906, 0.2627450980392157, 0.360284, 0.069247, 0.431497, 0.26666666666666666, 0.366529, 0.071579, 0.431994, 0.27058823529411763, 0.372768, 0.073915, 0.4324, 0.27450980392156865, 0.379001, 0.076253, 0.432719, 0.2784313725490196, 0.385228, 0.078591, 0.432955, 0.2823529411764706, 0.391453, 0.080927, 0.433109, 0.28627450980392155, 0.397674, 0.083257, 0.433183, 0.2901960784313725, 0.403894, 0.08558, 0.433179, 0.29411764705882354, 0.410113, 0.087896, 0.433098, 0.2980392156862745, 0.416331, 0.090203, 0.432943, 0.30196078431372547, 0.422549, 0.092501, 0.432714, 0.3058823529411765, 0.428768, 0.09479, 0.432412, 0.30980392156862746, 0.434987, 0.097069, 0.432039, 0.3137254901960784, 0.441207, 0.099338, 0.431594, 0.3176470588235294, 0.447428, 0.101597, 0.43108, 0.32156862745098036, 0.453651, 0.103848, 0.430498, 0.3254901960784314, 0.459875, 0.106089, 0.429846, 0.32941176470588235, 0.4661, 0.108322, 0.429125, 0.3333333333333333, 0.472328, 0.110547, 0.428334, 0.33725490196078434, 0.478558, 0.112764, 0.427475, 0.3411764705882353, 0.484789, 0.114974, 0.426548, 0.34509803921568627, 0.491022, 0.117179, 0.425552, 0.34901960784313724, 0.497257, 0.119379, 0.424488, 0.3529411764705882, 0.503493, 0.121575, 0.423356, 0.3568627450980392, 0.50973, 0.123769, 0.422156, 0.3607843137254902, 0.515967, 0.12596, 0.420887, 0.36470588235294116, 0.522206, 0.12815, 0.419549, 0.3686274509803922, 0.528444, 0.130341, 0.418142, 0.37254901960784315, 0.534683, 0.132534, 0.416667, 0.3764705882352941, 0.54092, 0.134729, 0.415123, 0.3803921568627451, 0.547157, 0.136929, 0.413511, 0.38431372549019605, 0.553392, 0.139134, 0.411829, 0.38823529411764707, 0.559624, 0.141346, 0.410078, 0.39215686274509803, 0.565854, 0.143567, 0.408258, 0.396078431372549, 0.572081, 0.145797, 0.406369, 0.4, 0.578304, 0.148039, 0.404411, 0.403921568627451, 0.584521, 0.150294, 0.402385, 0.40784313725490196, 0.590734, 0.152563, 0.40029, 0.4117647058823529, 0.59694, 0.154848, 0.398125, 0.4156862745098039, 0.603139, 0.157151, 0.395891, 0.4196078431372549, 0.60933, 0.159474, 0.393589, 0.4235294117647059, 0.615513, 0.161817, 0.391219, 0.42745098039215684, 0.621685, 0.164184, 0.388781, 0.43137254901960786, 0.627847, 0.166575, 0.386276, 0.43529411764705883, 0.633998, 0.168992, 0.383704, 0.4392156862745098, 0.640135, 0.171438, 0.381065, 0.44313725490196076, 0.64626, 0.173914, 0.378359, 0.44705882352941173, 0.652369, 0.176421, 0.375586, 0.45098039215686275, 0.658463, 0.178962, 0.372748, 0.4549019607843137, 0.66454, 0.181539, 0.369846, 0.4588235294117647, 0.670599, 0.184153, 0.366879, 0.4627450980392157, 0.676638, 0.186807, 0.363849, 0.4666666666666667, 0.682656, 0.189501, 0.360757, 0.47058823529411764, 0.688653, 0.192239, 0.357603, 0.4745098039215686, 0.694627, 0.195021, 0.354388, 0.4784313725490196, 0.700576, 0.197851, 0.351113, 0.4823529411764706, 0.7065, 0.200728, 0.347777, 0.48627450980392156, 0.712396, 0.203656, 0.344383, 0.49019607843137253, 0.718264, 0.206636, 0.340931, 0.49411764705882355, 0.724103, 0.20967, 0.337424, 0.4980392156862745, 0.729909, 0.212759, 0.333861, 0.5019607843137255, 0.735683, 0.215906, 0.330245, 0.5058823529411764, 0.741423, 0.219112, 0.326576, 0.5098039215686274, 0.747127, 0.222378, 0.322856, 0.5137254901960784, 0.752794, 0.225706, 0.319085, 0.5176470588235293, 0.758422, 0.229097, 0.315266, 0.5215686274509804, 0.76401, 0.232554, 0.311399, 0.5254901960784314, 0.769556, 0.236077, 0.307485, 0.5294117647058824, 0.775059, 0.239667, 0.303526, 0.5333333333333333, 0.780517, 0.243327, 0.299523, 0.5372549019607843, 0.785929, 0.247056, 0.295477, 0.5411764705882353, 0.791293, 0.250856, 0.29139, 0.5450980392156862, 0.796607, 0.254728, 0.287264, 0.5490196078431373, 0.801871, 0.258674, 0.283099, 0.5529411764705883, 0.807082, 0.262692, 0.278898, 0.5568627450980392, 0.812239, 0.266786, 0.274661, 0.5607843137254902, 0.817341, 0.270954, 0.27039, 0.5647058823529412, 0.822386, 0.275197, 0.266085, 0.5686274509803921, 0.827372, 0.279517, 0.26175, 0.5725490196078431, 0.832299, 0.283913, 0.257383, 0.5764705882352941, 0.837165, 0.288385, 0.252988, 0.580392156862745, 0.841969, 0.292933, 0.248564, 0.5843137254901961, 0.846709, 0.297559, 0.244113, 0.5882352941176471, 0.851384, 0.30226, 0.239636, 0.592156862745098, 0.855992, 0.307038, 0.235133, 0.596078431372549, 0.860533, 0.311892, 0.230606, 0.6, 0.865006, 0.316822, 0.226055, 0.6039215686274509, 0.869409, 0.321827, 0.221482, 0.6078431372549019, 0.873741, 0.326906, 0.216886, 0.611764705882353, 0.878001, 0.33206, 0.212268, 0.615686274509804, 0.882188, 0.337287, 0.207628, 0.6196078431372549, 0.886302, 0.342586, 0.202968, 0.6235294117647059, 0.890341, 0.347957, 0.198286, 0.6274509803921569, 0.894305, 0.353399, 0.193584, 0.6313725490196078, 0.898192, 0.358911, 0.18886, 0.6352941176470588, 0.902003, 0.364492, 0.184116, 0.6392156862745098, 0.905735, 0.37014, 0.17935, 0.6431372549019607, 0.90939, 0.375856, 0.174563, 0.6470588235294118, 0.912966, 0.381636, 0.169755, 0.6509803921568628, 0.916462, 0.387481, 0.164924, 0.6549019607843137, 0.919879, 0.393389, 0.16007, 0.6588235294117647, 0.923215, 0.399359, 0.155193, 0.6627450980392157, 0.92647, 0.405389, 0.150292, 0.6666666666666666, 0.929644, 0.411479, 0.145367, 0.6705882352941176, 0.932737, 0.417627, 0.140417, 0.6745098039215687, 0.935747, 0.423831, 0.13544, 0.6784313725490196, 0.938675, 0.430091, 0.130438, 0.6823529411764706, 0.941521, 0.436405, 0.125409, 0.6862745098039216, 0.944285, 0.442772, 0.120354, 0.6901960784313725, 0.946965, 0.449191, 0.115272, 0.6941176470588235, 0.949562, 0.45566, 0.110164, 0.6980392156862745, 0.952075, 0.462178, 0.105031, 0.7019607843137254, 0.954506, 0.468744, 0.099874, 0.7058823529411764, 0.956852, 0.475356, 0.094695, 0.7098039215686275, 0.959114, 0.482014, 0.089499, 0.7137254901960784, 0.961293, 0.488716, 0.084289, 0.7176470588235294, 0.963387, 0.495462, 0.079073, 0.7215686274509804, 0.965397, 0.502249, 0.073859, 0.7254901960784313, 0.967322, 0.509078, 0.068659, 0.7294117647058823, 0.969163, 0.515946, 0.063488, 0.7333333333333333, 0.970919, 0.522853, 0.058367, 0.7372549019607844, 0.97259, 0.529798, 0.053324, 0.7411764705882353, 0.974176, 0.53678, 0.048392, 0.7450980392156863, 0.975677, 0.543798, 0.043618, 0.7490196078431373, 0.977092, 0.55085, 0.03905, 0.7529411764705882, 0.978422, 0.557937, 0.034931, 0.7568627450980392, 0.979666, 0.565057, 0.031409, 0.7607843137254902, 0.980824, 0.572209, 0.028508, 0.7647058823529411, 0.981895, 0.579392, 0.02625, 0.7686274509803921, 0.982881, 0.586606, 0.024661, 0.7725490196078432, 0.983779, 0.593849, 0.02377, 0.7764705882352941, 0.984591, 0.601122, 0.023606, 0.7803921568627451, 0.985315, 0.608422, 0.024202, 0.7843137254901961, 0.985952, 0.61575, 0.025592, 0.788235294117647, 0.986502, 0.623105, 0.027814, 0.792156862745098, 0.986964, 0.630485, 0.030908, 0.796078431372549, 0.987337, 0.63789, 0.034916, 0.8, 0.987622, 0.64532, 0.039886, 0.803921568627451, 0.987819, 0.652773, 0.045581, 0.807843137254902, 0.987926, 0.66025, 0.05175, 0.8117647058823529, 0.987945, 0.667748, 0.058329, 0.8156862745098039, 0.987874, 0.675267, 0.065257, 0.8196078431372549, 0.987714, 0.682807, 0.072489, 0.8235294117647058, 0.987464, 0.690366, 0.07999, 0.8274509803921568, 0.987124, 0.697944, 0.087731, 0.8313725490196078, 0.986694, 0.70554, 0.095694, 0.8352941176470589, 0.986175, 0.713153, 0.103863, 0.8392156862745098, 0.985566, 0.720782, 0.112229, 0.8431372549019608, 0.984865, 0.728427, 0.120785, 0.8470588235294118, 0.984075, 0.736087, 0.129527, 0.8509803921568627, 0.983196, 0.743758, 0.138453, 0.8549019607843137, 0.982228, 0.751442, 0.147565, 0.8588235294117647, 0.981173, 0.759135, 0.156863, 0.8627450980392157, 0.980032, 0.766837, 0.166353, 0.8666666666666667, 0.978806, 0.774545, 0.176037, 0.8705882352941177, 0.977497, 0.782258, 0.185923, 0.8745098039215686, 0.976108, 0.789974, 0.196018, 0.8784313725490196, 0.974638, 0.797692, 0.206332, 0.8823529411764706, 0.973088, 0.805409, 0.216877, 0.8862745098039215, 0.971468, 0.813122, 0.227658, 0.8901960784313725, 0.969783, 0.820825, 0.238686, 0.8941176470588235, 0.968041, 0.828515, 0.249972, 0.8980392156862745, 0.966243, 0.836191, 0.261534, 0.9019607843137255, 0.964394, 0.843848, 0.273391, 0.9058823529411765, 0.962517, 0.851476, 0.285546, 0.9098039215686274, 0.960626, 0.859069, 0.29801, 0.9137254901960784, 0.95872, 0.866624, 0.31082, 0.9176470588235294, 0.956834, 0.874129, 0.323974, 0.9215686274509803, 0.954997, 0.881569, 0.337475, 0.9254901960784314, 0.953215, 0.888942, 0.351369, 0.9294117647058824, 0.951546, 0.896226, 0.365627, 0.9333333333333333, 0.950018, 0.903409, 0.380271, 0.9372549019607843, 0.948683, 0.910473, 0.395289, 0.9411764705882353, 0.947594, 0.917399, 0.410665, 0.9450980392156862, 0.946809, 0.924168, 0.426373, 0.9490196078431372, 0.946392, 0.930761, 0.442367, 0.9529411764705882, 0.946403, 0.937159, 0.458592, 0.9568627450980391, 0.946903, 0.943348, 0.47497, 0.9607843137254902, 0.947937, 0.949318, 0.491426, 0.9647058823529412, 0.949545, 0.955063, 0.50786, 0.9686274509803922, 0.95174, 0.960587, 0.524203, 0.9725490196078431, 0.954529, 0.965896, 0.540361, 0.9764705882352941, 0.957896, 0.971003, 0.556275, 0.9803921568627451, 0.961812, 0.975924, 0.571925, 0.984313725490196, 0.966249, 0.980678, 0.587206, 0.9882352941176471, 0.971162, 0.985282, 0.602154, 0.9921568627450981, 0.976511, 0.989753, 0.61676, 0.996078431372549, 0.982257, 0.994109, 0.631017, 1.0, 0.988362, 0.998364, 0.644924], side='front', wireframe=False, opacity=1.0, volume=[], volume_bounds=[], opacity_function=[], name=None, compression_level=0, cell_color_attribute=None, **kwargs)[source]

Create a Mesh drawable from given vtkPolyData.

This function requires the vtk module (from package VTK) to be installed.

Arguments:
poly_data: vtkPolyData.

Native vtkPolyData geometry.

color: int.

Packed RGB color of the resulting mesh (0xff0000 is red, 0xff is blue) when not using color maps.

color_attribute: tuple of (str, float, float).

This determines which scalar should be taken as the attribute for the color_map, and the color_range for the mesh: (attribute_name, min_value, max_value). A VTK mesh can have multiple named attributes in the vertices. min_value is the value mapped to 0 in the color_map. max_value is the value mapped to 1 in the color_map.

cell_color_attribute: tuple of (str, float, float).

This determines which scalar should be taken as the attribute for the color_map, and the color_range for the mesh: (attribute_name, min_value, max_value). A VTK mesh can have multiple named attributes in the vertices. min_value is the value mapped to 0 in the color_map. max_value is the value mapped to 1 in the color_map.

color_map: list.

A list of float quadruplets (attribute value, R, G, B), sorted by attribute value. The first quadruplet should have value 0.0, the last 1.0; R, G, B are RGB color components in the range 0.0 to 1.0.

wireframe: bool.

Whether mesh should display as wireframe.

opacity: float.

Opacity of mesh.

volume: array_like.

3D array of float

volume_bounds: array_like.

6-element tuple specifying the bounds of the volume data (x0, x1, y0, y1, z0, z1)

opacity_function: array.

A list of float tuples (attribute value, opacity), sorted by attribute value. The first typles should have value 0.0, the last 1.0; opacity is in the range 0.0 to 1.0.

side: string.

Control over which side to render for a mesh. Legal values are front, back, double.

name: string.

A name of a object

kwargs: dict.

Dictionary arguments to configure transform and model_matrix.

k3d.objects module

class k3d.objects.Drawable(**kwargs)[source]

Bases: ipywidgets.widgets.widget.Widget

Base class for drawable objects and groups.

compression_level

An int trait.

fetch_data(field)[source]

Request updating the value of a field modified in browser.

For data modified in the widget on the browser side, this triggers an asynchronous update of the value in the Python kernel.

Only specific features require this mechanism, e.g. the in-browser editing of voxels.

Arguments:
field: str.

The field name.

id

An int trait.

name

A trait for unicode strings.

push_data(field)[source]

Request updating the value of a field modified in backend.

For data modified in the backend side, this triggers an asynchronous update of the value in the browser widget.

Only specific features require this mechanism, e.g. the in-browser editing of voxels.

Arguments:
field: str.

The field name.

visible
class k3d.objects.DrawableWithCallback(**kwargs)[source]

Bases: k3d.objects.Drawable

Base class for drawable with callback handling

click_callback

A trait which allows any value.

hover_callback

A trait which allows any value.

class k3d.objects.DrawableWithVoxelCallback(**kwargs)[source]

Bases: k3d.objects.Drawable

Base class for drawable with voxels callback handling

click_callback = None
hover_callback = None
class k3d.objects.Group(**kwargs)[source]

Bases: k3d.objects.Drawable

An aggregated group of Drawables, itself a Drawable.

It can be inserted or removed from a Plot including all members.

class k3d.objects.Label(**kwargs)[source]

Bases: k3d.objects.Drawable

Label rendered using KaTeX with a 3D position.

Attributes:
text: str.

Content of the text.

position: list.

Coordinates (x, y, z) of the text’s position.

color: int.

Packed RGB color of the text (0xff0000 is red, 0xff is blue).

on_top: Boolean.

Render order with 3d object

label_box: Boolean.

Label background box.

mode: str.

Label node. Can be ‘dynamic’, ‘local’ or ‘side’.

is_html: Boolean.

Whether text should be interpreted as HTML insted of KaTeX.

max_length: float.

Maximum length of line in % of half screen size.

size: float.

Font size in ‘em’ HTML units.

color

An int trait.

get_bounding_box()[source]
is_html

A boolean (True, False) trait.

label_box

A boolean (True, False) trait.

max_length

A float trait.

mode

A trait for unicode strings.

on_top

A boolean (True, False) trait.

position
size
text
type

A trait for unicode strings.

class k3d.objects.Line(**kwargs)[source]

Bases: k3d.objects.Drawable

A path (polyline) made up of line segments.

Attributes:
vertices: array_like.

An array with (x, y, z) coordinates of segment endpoints.

colors: array_like.

Same-length array of (int) packed RGB color of the points (0xff0000 is red, 0xff is blue).

color: int.

Packed RGB color of the lines (0xff0000 is red, 0xff is blue) when colors is empty.

attribute: array_like.

Array of float attribute for the color mapping, coresponding to each vertex.

color_map: list.

A list of float quadruplets (attribute value, R, G, B), sorted by attribute value. The first quadruplet should have value 0.0, the last 1.0; R, G, B are RGB color components in the range 0.0 to 1.0.

color_range: list.

A pair [min_value, max_value], which determines the levels of color attribute mapped to 0 and 1 in the color map respectively.

width: float.

The thickness of the lines.

shader: str.

Display style (name of the shader used) of the lines. Legal values are:

simple

simple lines,

thick

thick lines,

mesh

high precision triangle mesh of segments (high quality and GPU load).

radial_segments: ‘int’:

Number of segmented faces around the circumference of the tube.

model_matrix: array_like.

4x4 model transform matrix.

attribute
color
color_map
color_range
colors
get_bounding_box()[source]
model_matrix
radial_segments
shader
type

A trait for unicode strings.

vertices
width
class k3d.objects.ListOrArray(*args, **kwargs)[source]

Bases: traitlets.traitlets.List

validate_elements(obj, value)[source]
class k3d.objects.MIP(**kwargs)[source]

Bases: k3d.objects.Drawable

3D volumetric data.

By default, the volume are a grid inscribed in the -0.5 < x, y, z < 0.5 cube regardless of the passed voxel array shape (aspect ratio etc.).

Attributes:
volume: array_like.

3D array of float.

color_map: array_like.

A list of float quadruplets (attribute value, R, G, B), sorted by attribute value. The first quadruplet should have value 0.0, the last 1.0; R, G, B are RGB color components in the range 0.0 to 1.0.

opacity_function: array.

A list of float tuples (attribute value, opacity), sorted by attribute value. The first typles should have value 0.0, the last 1.0; opacity is in the range 0.0 to 1.0.

color_range: list.

A pair [min_value, max_value], which determines the levels of color attribute mapped to 0 and 1 in the color map respectively.

samples: float.

Number of iteration per 1 unit of space.

gradient_step: float

Gradient light step.

model_matrix: array_like.

4x4 model transform matrix.

color_map
color_range
get_bounding_box()[source]
gradient_step
model_matrix
opacity_function
samples
type

A trait for unicode strings.

volume
class k3d.objects.MarchingCubes(**kwargs)[source]

Bases: k3d.objects.DrawableWithCallback

An isosurface in a scalar field obtained through Marching Cubes algorithm.

The default domain of the scalar field is -0.5 < x, y, z < 0.5. If the domain should be different, the bounding box needs to be transformed using the model_matrix.

Attributes:
scalar_field: array_like.

A 3D scalar field of values.

level: float.

Value at the computed isosurface.

spacings_x: array_like.

A spacings in x axis. Should match to scalar_field shape.

spacings_y: array_like.

A spacings in y axis. Should match to scalar_field shape.

spacings_z: array_like.

A spacings in z axis. Should match to scalar_field shape.

color: int.

Packed RGB color of the isosurface (0xff0000 is red, 0xff is blue).

wireframe: bool.

Whether mesh should display as wireframe.

flat_shading: bool.

Whether mesh should display with flat shading.

opacity: float.

Opacity of mesh.

model_matrix: array_like.

4x4 model transform matrix.

color

An int trait.

flat_shading

A boolean (True, False) trait.

get_bounding_box()[source]
level

A float trait.

model_matrix
opacity
scalar_field

A numpy array trait type.

spacings_x

A numpy array trait type.

spacings_y

A numpy array trait type.

spacings_z

A numpy array trait type.

type

A trait for unicode strings.

wireframe

A boolean (True, False) trait.

class k3d.objects.Mesh(**kwargs)[source]

Bases: k3d.objects.DrawableWithCallback

A 3D triangles mesh.

Attributes:
vertices: array_like.

Array of triangle vertices: float (x, y, z) coordinate triplets.

indices: array_like.

Array of vertex indices: int triplets of indices from vertices array.

color: int.

Packed RGB color of the mesh (0xff0000 is red, 0xff is blue) when not using color maps.

colors: array_like.

Same-length array of (int) packed RGB color of the points (0xff0000 is red, 0xff is blue).

attribute: array_like.

Array of float attribute for the color mapping, coresponding to each vertex.

triangles_attribute: array_like.

Array of float attribute for the color mapping, coresponding to each triangle.

color_map: list.

A list of float quadruplets (attribute value, R, G, B), sorted by attribute value. The first quadruplet should have value 0.0, the last 1.0; R, G, B are RGB color components in the range 0.0 to 1.0.

color_range: list.

A pair [min_value, max_value], which determines the levels of color attribute mapped to 0 and 1 in the color map respectively.

wireframe: bool.

Whether mesh should display as wireframe.

flat_shading: bool.

Whether mesh should display with flat shading.

opacity: float.

Opacity of mesh.

volume: array_like.

3D array of float

volume_bounds: array_like.

6-element tuple specifying the bounds of the volume data (x0, x1, y0, y1, z0, z1)

texture: bytes.

Image data in a specific format.

texture_file_format: str.

Format of the data, it should be the second part of MIME format of type ‘image/’, for example ‘jpeg’, ‘png’, ‘gif’, ‘tiff’.

uvs: array_like.

Array of float uvs for the texturing, coresponding to each vertex.

model_matrix: array_like.

4x4 model transform matrix.

attribute
color
color_map
color_range
colors
flat_shading
get_bounding_box()[source]
indices
model_matrix
opacity
opacity_function
side
texture

A trait for byte strings.

texture_file_format

A trait for unicode strings.

triangles_attribute
type

A trait for unicode strings.

uvs
vertices
volume
volume_bounds
wireframe
class k3d.objects.Points(**kwargs)[source]

Bases: k3d.objects.Drawable

A point cloud.

Attributes:
positions: array_like.

Array with (x, y, z) coordinates of the points.

colors: array_like.

Same-length array of (int) packed RGB color of the points (0xff0000 is red, 0xff is blue).

color: int.

Packed RGB color of the points (0xff0000 is red, 0xff is blue) when colors is empty.

point_size: float.

Diameter of the balls representing the points in 3D space.

shader: str.

Display style (name of the shader used) of the points. Legal values are:

flat

simple circles with uniform color,

dot

simple dot with uniform color,

3d

little 3D balls,

3dSpecular

little 3D balls with specular lightning,

mesh

high precision triangle mesh of a ball (high quality and GPU load).

mesh_detail: int.

Default is 2. Setting this to a value greater than 0 adds more vertices making it no longer an icosahedron. When detail is greater than 1, it’s effectively a sphere. Only valid if shader=’mesh’

attribute: array_like.

Array of float attribute for the color mapping, coresponding to each point.

color_map: list.

A list of float quadruplets (attribute value, R, G, B), sorted by attribute value. The first quadruplet should have value 0.0, the last 1.0; R, G, B are RGB color components in the range 0.0 to 1.0.

color_range: list.

A pair [min_value, max_value], which determines the levels of color attribute mapped to 0 and 1 in the color map respectively.

opacity_function: array.

A list of float tuples (attribute value, opacity), sorted by attribute value. The first tuples should have value 0.0, the last 1.0; opacity is in the range 0.0 to 1.0.

model_matrix: array_like.

4x4 model transform matrix.

attribute
color
color_map
color_range
colors
get_bounding_box()[source]
mesh_detail
model_matrix
opacities
opacity
opacity_function
point_size
positions
shader
type

A trait for unicode strings.

class k3d.objects.STL(**kwargs)[source]

Bases: k3d.objects.Drawable

A STereoLitograpy 3D geometry.

STL is a popular format introduced for 3D printing. There are two sub-formats - ASCII and binary.

Attributes:
text: str.

STL data in text format (ASCII STL).

binary: bytes.

STL data in binary format (Binary STL). The text attribute should be set to None when using Binary STL.

color: int.

Packed RGB color of the resulting mesh (0xff0000 is red, 0xff is blue).

model_matrix: array_like.

4x4 model transform matrix.

wireframe: bool.

Whether mesh should display as wireframe.

flat_shading: bool.

Whether mesh should display with flat shading.

binary
color

An int trait.

flat_shading

A boolean (True, False) trait.

get_bounding_box()[source]
model_matrix
text
type

A trait for unicode strings.

wireframe

A boolean (True, False) trait.

class k3d.objects.SparseVoxels(**kwargs)[source]

Bases: k3d.objects.DrawableWithVoxelCallback

3D volumetric data.

By default, the voxels are a grid inscribed in the -0.5 < x, y, z < 0.5 cube regardless of the passed voxel array shape (aspect ratio etc.). Different grid size, shape and rotation can be obtained using the model_matrix.

Attributes:
sparse_voxels: array_like.

2D array of coords in format [[x,y,z,v],[x,y,z,v]]. v = 0 means empty voxel, 1 and above refer to consecutive color_map entries.

space_size: array_like.

Width, Height, Length of space

color_map: array_like.

Flat array of int packed RGB colors (0xff0000 is red, 0xff is blue).

model_matrix: array_like.

4x4 model transform matrix.

wireframe: bool.

Whether mesh should display as wireframe.

opacity: float.

Opacity of voxels.

outlines: bool.

Whether mesh should display with outlines.

outlines_color: int.

Packed RGB color of the resulting outlines (0xff0000 is red, 0xff is blue)

color_map

A numpy array trait type.

get_bounding_box()[source]
model_matrix
opacity
outlines

A boolean (True, False) trait.

outlines_color

An int trait.

space_size

A numpy array trait type.

sparse_voxels

A numpy array trait type.

type

A trait for unicode strings.

wireframe

A boolean (True, False) trait.

class k3d.objects.Surface(**kwargs)[source]

Bases: k3d.objects.DrawableWithCallback

Surface plot of a 2D function z = f(x, y).

The default domain of the scalar field is -0.5 < x, y < 0.5. If the domain should be different, the bounding box needs to be transformed using the model_matrix.

Attributes:
heights: array_like.

2D scalar field of Z values.

color: int.

Packed RGB color of the resulting mesh (0xff0000 is red, 0xff is blue).

wireframe: bool.

Whether mesh should display as wireframe.

flat_shading: bool.

Whether mesh should display with flat shading.

attribute: array_like.

Array of float attribute for the color mapping, coresponding to each vertex.

color_map: list.

A list of float quadruplets (attribute value, R, G, B), sorted by attribute value. The first quadruplet should have value 0.0, the last 1.0; R, G, B are RGB color components in the range 0.0 to 1.0.

color_range: list.

A pair [min_value, max_value], which determines the levels of color attribute mapped to 0 and 1 in the color map respectively.

model_matrix: array_like.

4x4 model transform matrix.

attribute
color

An int trait.

color_map
color_range
flat_shading

A boolean (True, False) trait.

get_bounding_box()[source]
heights
model_matrix
type

A trait for unicode strings.

wireframe

A boolean (True, False) trait.

class k3d.objects.Text(**kwargs)[source]

Bases: k3d.objects.Drawable

Text rendered using KaTeX with a 3D position.

Attributes:
text: str.

Content of the text.

position: list.

Coordinates (x, y, z) of the text’s position.

color: int.

Packed RGB color of the text (0xff0000 is red, 0xff is blue).

is_html: Boolean.

Whether text should be interpreted as HTML insted of KaTeX.

on_top: Boolean.

Render order with 3d object

reference_point: str.

Two-letter string representing the text’s alignment.

First letter: ‘l’, ‘c’ or ‘r’: left, center or right

Second letter: ‘t’, ‘c’ or ‘b’: top, center or bottom.

size: float.

Font size in ‘em’ HTML units.

label_box: Boolean.

Label background box.

color

An int trait.

get_bounding_box()[source]
is_html

A boolean (True, False) trait.

label_box

A boolean (True, False) trait.

on_top

A boolean (True, False) trait.

position
reference_point

A trait for unicode strings.

size
text
type

A trait for unicode strings.

class k3d.objects.Text2d(**kwargs)[source]

Bases: k3d.objects.Drawable

Text rendered using KaTeX with a fixed 2D position, independent of camera settings.

Attributes:
text: str.

Content of the text.

position: list.

Ratios (r_x, r_y) of the text’s position in range (0, 1) - relative to canvas size.

color: int.

Packed RGB color of the text (0xff0000 is red, 0xff is blue).

is_html: Boolean.

Whether text should be interpreted as HTML insted of KaTeX.

reference_point: str.

Two-letter string representing the text’s alignment.

First letter: ‘l’, ‘c’ or ‘r’: left, center or right

Second letter: ‘t’, ‘c’ or ‘b’: top, center or bottom.

size: float.

Font size in ‘em’ HTML units.

label_box: Boolean.

Label background box.

color

An int trait.

get_bounding_box()[source]
is_html

A boolean (True, False) trait.

label_box

A boolean (True, False) trait.

position
reference_point

A trait for unicode strings.

size
text
type

A trait for unicode strings.

class k3d.objects.Texture(**kwargs)[source]

Bases: k3d.objects.DrawableWithCallback

A 2D image displayed as a texture.

By default, the texture image is mapped into the square: -0.5 < x, y < 0.5, z = 1. If the size (scale, aspect ratio) or position should be different then the texture should be transformed using the model_matrix.

Attributes:
binary: bytes.

Image data in a specific format.

file_format: str.

Format of the data, it should be the second part of MIME format of type ‘image/’, for example ‘jpeg’, ‘png’, ‘gif’, ‘tiff’.

attribute: array_like.

Array of float attribute for the color mapping, coresponding to each pixels.

color_map: list.

A list of float quadruplets (attribute value, R, G, B), sorted by attribute value. The first quadruplet should have value 0.0, the last 1.0; R, G, B are RGB color components in the range 0.0 to 1.0.

opacity_function: array.

A list of float tuples (attribute value, opacity), sorted by attribute value. The first tuples should have value 0.0, the last 1.0; opacity is in the range 0.0 to 1.0.

color_range: list.

A pair [min_value, max_value], which determines the levels of color attribute mapped to 0 and 1 in the color map respectively.

interpolation: bool.

Whether data should be interpolatedor not.

puv: list.

A list of float triplets (x,y,z). The first triplet mean a position of left-bottom corner of texture. Second and third triplets means a base of coordinate system for texture.

model_matrix: array_like.

4x4 model transform matrix.

attribute

A numpy array trait type.

binary

A trait for byte strings.

color_map

A numpy array trait type.

color_range
file_format

A trait for unicode strings.

get_bounding_box()[source]
interpolation
model_matrix
opacity_function
puv

A numpy array trait type.

type

A trait for unicode strings.

class k3d.objects.TextureText(**kwargs)[source]

Bases: k3d.objects.Drawable

A text in the 3D space rendered using a texture.

Compared to Text and Text2d this drawable has less features (no KaTeX support), but the labels are located in the GPU memory, and not the browser’s DOM tree. This has performance consequences, and may be preferable when many simple labels need to be displayed.

Attributes:
text: str.

Content of the text.

position: list.

Coordinates (x, y, z) of the text’s position.

color: int.

Packed RGB color of the text (0xff0000 is red, 0xff is blue).

size: float.

Size of the texture sprite containing the text.

font_face: str.

Name of the font to use for rendering the text.

font_weight: int.

Thickness of the characters in HTML-like units from the range (100, 900), where 400 is normal and 600 is bold font.

font_size: int.

The font size inside the sprite texture in px units. This does not affect the size of the text in the scene, only the accuracy and raster size of the texture.

color
font_face

A trait for unicode strings.

font_size

An int trait.

font_weight

An int trait.

get_bounding_box()[source]
position
size
text
type

A trait for unicode strings.

class k3d.objects.TimeSeries(trait)[source]

Bases: traitlets.traitlets.Union

class k3d.objects.VectorField(**kwargs)[source]

Bases: k3d.objects.Drawable

A dense 3D or 2D vector field.

By default, the origins of the vectors are assumed to be a grid inscribed in the -0.5 < x, y, z < 0.5 cube or -0.5 < x, y < 0.5 square, regardless of the passed vector field shape (aspect ratio etc.). Different grid size, shape and rotation can be obtained using the model_matrix.

The color of the vectors is a gradient from origin_color to head_color. Heads, when used, have uniform head_color.

For sparse (i.e. not forming a grid) 3D vectors, use the Vectors drawable.

Attributes:
vectors: array_like.

Vector field of shape (L, H, W, 3) for 3D fields or (H, W, 2) for 2D fields.

colors: array_like.

Twice the length of vectors array of int: packed RGB colors (0xff0000 is red, 0xff is blue). The array has consecutive pairs (origin_color, head_color) for vectors in row-major order.

origin_color: int.

Packed RGB color of the origins (0xff0000 is red, 0xff is blue) when colors is empty.

head_color: int.

Packed RGB color of the vector heads (0xff0000 is red, 0xff is blue) when colors is empty.

use_head: bool.

Whether vectors should display an arrow head.

head_size: float.

The size of the arrow heads.

scale: float.

Scale factor for the vector lengths, for artificially scaling the vectors in place.

line_width: float.

Width of the vector segments.

model_matrix: array_like.

4x4 model transform matrix.

colors

A numpy array trait type.

get_bounding_box()[source]
head_color

An int trait.

head_size

A float trait.

line_width

A float trait.

model_matrix
origin_color

An int trait.

scale

A float trait.

type

A trait for unicode strings.

use_head

A boolean (True, False) trait.

vectors

A numpy array trait type.

class k3d.objects.Vectors(**kwargs)[source]

Bases: k3d.objects.Drawable

3D vectors.

The color of the vectors is a gradient from origin_color to head_color. Heads, when used, have uniform head_color.

For dense (i.e. forming a grid) 3D or 2D vectors, use the VectorField drawable.

Attributes:
vectors: array_like.

The vectors as (dx, dy, dz) float triples.

origins: array_like.

Same-size array of (x, y, z) coordinates of vector origins.

colors: array_like.

Twice the length of vectors array of int: packed RGB colors (0xff0000 is red, 0xff is blue). The array has consecutive pairs (origin_color, head_color) for vectors in row-major order.

origin_color: int.

Packed RGB color of the origins (0xff0000 is red, 0xff is blue), default: same as color.

head_color: int.

Packed RGB color of the vector heads (0xff0000 is red, 0xff is blue), default: same as color.

use_head: bool.

Whether vectors should display an arrow head.

head_size: float.

The size of the arrow heads.

labels: list of str.

Captions to display next to the vectors.

label_size: float.

Label font size in ‘em’ HTML units.

line_width: float.

Width of the vector segments.

model_matrix: array_like.

4x4 model transform matrix.

colors

A numpy array trait type.

get_bounding_box()[source]
head_color

An int trait.

head_size

A float trait.

label_size

A float trait.

labels

An instance of a Python list.

line_width

A float trait.

model_matrix
origin_color

An int trait.

origins

A numpy array trait type.

type

A trait for unicode strings.

use_head

A boolean (True, False) trait.

vectors

A numpy array trait type.

class k3d.objects.Volume(**kwargs)[source]

Bases: k3d.objects.Drawable

3D volumetric data.

By default, the volume are a grid inscribed in the -0.5 < x, y, z < 0.5 cube regardless of the passed voxel array shape (aspect ratio etc.).

Attributes:
volume: array_like.

3D array of float.

color_map: array_like.

A list of float quadruplets (attribute value, R, G, B), sorted by attribute value. The first quadruplet should have value 0.0, the last 1.0; R, G, B are RGB color components in the range 0.0 to 1.0.

opacity_function: array.

A list of float tuples (attribute value, opacity), sorted by attribute value. The first typles should have value 0.0, the last 1.0; opacity is in the range 0.0 to 1.0.

color_range: list.

A pair [min_value, max_value], which determines the levels of color attribute mapped to 0 and 1 in the color map respectively.

samples: float.

Number of iteration per 1 unit of space.

alpha_coef: float.

Alpha multiplier.

shadow: str.

Type of shadow on volume.

Legal values are:

off

shadow disabled,

on_demand

update shadow map on demand ( self.shadow_map_update() ),

dynamic

update shadow map automaticaly every shadow_delay.

shadow_delay: float.

Minimum number of miliseconds between shadow map updates.

shadow_res: int.

Resolution of shadow map.

interpolation: bool.

Whether volume raycasting should interpolate data or not.

model_matrix: array_like.

4x4 model transform matrix.

alpha_coef
color_map
color_range
focal_length
focal_plane
get_bounding_box()[source]
gradient_step
interpolation
model_matrix
opacity_function
ray_samples_count
samples
shadow
shadow_delay
shadow_map_update(direction=None)[source]

Request updating the shadow map in browser.

shadow_res
type

A trait for unicode strings.

volume
class k3d.objects.VoxelChunk(**kwargs)[source]

Bases: ipywidgets.widgets.widget.Widget

Voxel chunk class for selective updating voxels

coord

A numpy array trait type.

id

An int trait.

multiple

An int trait.

push_data(field)[source]
voxels

A numpy array trait type.

class k3d.objects.Voxels(**kwargs)[source]

Bases: k3d.objects.DrawableWithVoxelCallback

3D volumetric data.

Different grid size, shape and rotation can be obtained using model_matrix.

Attributes:
voxels: array_like.

3D array of int in range (0, 255). 0 means empty voxel, 1 and above refer to consecutive color_map entries.

color_map: array_like.

Flat array of int packed RGB colors (0xff0000 is red, 0xff is blue).

The color defined at index i is for voxel value (i+1), e.g.:

color_map = [0xff, 0x00ff]
voxels =
[
0, # empty voxel
1, # blue voxel
2 # red voxel
]
model_matrix: array_like.

4x4 model transform matrix.

wireframe: bool.

Whether mesh should display as wireframe.

opacity: float.

Opacity of voxels.

outlines: bool.

Whether mesh should display with outlines.

outlines_color: int.

Packed RGB color of the resulting outlines (0xff0000 is red, 0xff is blue)

color_map

A numpy array trait type.

get_bounding_box()[source]
model_matrix
opacity
outlines

A boolean (True, False) trait.

outlines_color

An int trait.

type

A trait for unicode strings.

voxels

A numpy array trait type.

wireframe

A boolean (True, False) trait.

class k3d.objects.VoxelsGroup(**kwargs)[source]

Bases: k3d.objects.DrawableWithVoxelCallback

3D volumetric data.

By default, the voxels are a grid inscribed in the -0.5 < x, y, z < 0.5 cube regardless of the passed voxel array shape (aspect ratio etc.). Different grid size, shape and rotation can be obtained using the model_matrix.

Attributes:
voxels_group: array_like.

List of chunks in format {voxels: np.array, coord: [x,y,z], multiple: number}.

space_size: array_like.

Width, Height, Length of space

color_map: array_like.

Flat array of int packed RGB colors (0xff0000 is red, 0xff is blue).

model_matrix: array_like.

4x4 model transform matrix.

wireframe: bool.

Whether mesh should display as wireframe.

opacity: float.

Opacity of voxels.

outlines: bool.

Whether mesh should display with outlines.

outlines_color: int.

Packed RGB color of the resulting outlines (0xff0000 is red, 0xff is blue)

chunks_ids

An instance of a Python list.

color_map

A numpy array trait type.

get_bounding_box()[source]
model_matrix
opacity
outlines

A boolean (True, False) trait.

outlines_color

An int trait.

space_size

A numpy array trait type.

type

A trait for unicode strings.

voxels_group

An instance of a Python list.

wireframe

A boolean (True, False) trait.

k3d.plot module

class k3d.plot.Plot(**kwargs)[source]

Bases: ipywidgets.widgets.domwidget.DOMWidget

Main K3D widget.

Attributes:
antialias: int:

Enable antialiasing in WebGL renderer, changes have no effect after displaying.

height: int:

Height of the Widget in pixels, changes have no effect after displaying.

background_color: int.

Packed RGB color of the plot background (0xff0000 is red, 0xff is blue), -1 is for transparent.

camera_auto_fit: bool.

Enable automatic camera setting after adding, removing or changing a plot object.

grid_auto_fit: bool.

Enable automatic adjustment of the plot grid to contained objects.

grid_color: int.

Packed RGB color of the plot grids (0xff0000 is red, 0xff is blue).

grid_visible: bool.

Enable or disable grid.

screenshot_scale: Float.

Multipiler to screenshot resolution.

voxel_paint_color: int.

The (initial) int value to be inserted when editing voxels.

lighting: Float.

Lighting factor.

grid: array_like.

6-element tuple specifying the bounds of the plot grid (x0, y0, z0, x1, y1, z1).

camera: array_like.

9-element list or array specifying camera position.

camera_no_rotate: Bool.

Lock for camera rotation.

camera_no_zoom: Bool.

Lock for camera zoom.

camera_no_pan: Bool.

Lock for camera pan.

camera_rotate_speed: Float.

Speed of camera rotation.

camera_zoom_speed: Float.

Speed of camera zoom.

camera_pan_speed: Float.

Speed of camera pan.

camera_fov: Float.

Camera Field of View.

snapshot_include_js: Bool.

If it’s true snapshot html is standalone.

axes: list.

Axes labels for plot.

time: list.

Time value (used in TimeSeries)

name: string.

Name of the plot. Used to filenames of snapshot/screenshot etc.

mode: str.

Mode of K3D viewer.

Legal values are:

view

No interaction with objects,

add

On voxels objects adding mode,

change

On voxels objects edit mode,

callback

Handling click_callback and hover_callback on some type of objects,

manipulate

Enable object transform widget.

camera_mode: str.

Mode of camera movement.

Legal values are:

trackball

orbit around point with dynamic up-vector of camera,

orbit

orbit around point with fixed up-vector of camera,

fly

orbit around point with dynamic up-vector of camera, mouse wheel also moves target point.

manipulate_mode: str.

Mode of manipulate widgets.

Legal values are:

translate

Translation widget,

rotate

Rotation widget,

scale

Scaling widget.

auto_rendering: Bool.

State of auto rendering.

fps: Float.

Fps of animation.

objects: list.

List of k3d.objects.Drawable currently included in the plot, not to be changed directly.

antialias

An int trait.

auto_rendering

A boolean (True, False) trait.

axes

An instance of a Python list.

axes_helper

A float trait.

background_color

An int trait.

camera
camera_animation
camera_auto_fit

A boolean (True, False) trait.

camera_fov

A float trait.

camera_mode

A trait for unicode strings.

camera_no_pan

A boolean (True, False) trait.

camera_no_rotate

A boolean (True, False) trait.

camera_no_zoom

A boolean (True, False) trait.

camera_pan_speed

A float trait.

camera_reset(factor=1.5)[source]

Trigger auto-adjustment of camera.

Useful when self.camera_auto_fit == False.

camera_rotate_speed

A float trait.

camera_zoom_speed

A float trait.

clipping_planes
close()[source]

Remove plot from all its ipywidgets.Output()-s.

colorbar_object_id

An int trait.

colorbar_scientific

A boolean (True, False) trait.

display(**kwargs)[source]

Show plot inside ipywidgets.Output().

fetch_screenshot(only_canvas=False)[source]

Request creating a PNG screenshot on the JS side and saving it in self.screenshot

The result is a string of a PNG file in base64 encoding. This function requires a round-trip of websocket messages. The result will be available after the current cell finishes execution.

fetch_snapshot(compression_level=9)[source]

Request creating a HTML snapshot on the JS side and saving it in self.snapshot

The result is a string: a HTML document with this plot embedded. This function requires a round-trip of websocket messages. The result will be available after the current cell finishes execution.

fps

A float trait.

fps_meter

A boolean (True, False) trait.

get_auto_camera(factor=1.5, yaw=25, pitch=15)[source]
get_auto_grid()[source]
get_binary_snapshot_objects()[source]
get_snapshot(compression_level=9, additional_js_code='')[source]

Produce on the Python side a HTML document with the current plot embedded.

get_snapshot_params()[source]
grid
grid_auto_fit

A boolean (True, False) trait.

grid_color

An int trait.

grid_visible

A boolean (True, False) trait.

height

An int trait.

lighting

A float trait.

manipulate_mode

A trait for unicode strings.

menu_visibility

A boolean (True, False) trait.

mode

A trait for unicode strings.

name

A trait for unicode strings.

object_ids

An instance of a Python list.

objects = []
render()[source]

Trigger rendering on demand.

Useful when self.auto_rendering == False.

rendering_steps

An int trait.

screenshot

A trait for unicode strings.

screenshot_scale

A float trait.

snapshot

A trait for unicode strings.

snapshot_include_js

A boolean (True, False) trait.

start_auto_play()[source]

Start animation of plot with objects using TimeSeries.

stop_auto_play()[source]

Stop animation of plot with objects using TimeSeries.

time

A float trait.

voxel_paint_color

An int trait.

yield_screenshots(generator_function)[source]

Decorator for a generator function receiving screenshots via yield.

yield_snapshots(generator_function)[source]

Decorator for a generator function receiving snapshots via yield.

k3d.transform module

class k3d.transform.Transform(bounds=None, translation=None, rotation=None, scaling=None, custom_matrix=None, parent=None)[source]

Bases: object

Abstraction of a 4x4 model transformation matrix with hierarchy support.

add_drawable(drawable)[source]

Register a Drawable to have its model_matrix overwritten after changes to the transform or its parent.

parent_updated()[source]

Read updated parent transform matrix and update own model_matrix.

This method should be normally only called by parent Transform to notify its children.

k3d.transform.get_bounds_fit_matrix(xmin, xmax, ymin, ymax, zmin, zmax)[source]

Create a 4x4 transform matrix which maps the default bounding box ([-0.5, 0.5] in all dimensions) into a custom bounding box ([xmin, xmax, ymin, ymax, zmin, zmax]).

It is used for fitting fields (VectorField, Surface, MachingCubes) into custom domains.

k3d.transform.process_transform_arguments(drawable, **kwargs)[source]

Process keyword arguments dictionary for a drawable to create a Transform for it.

Keyword arguments:
transform: Transform.

An existing transform object to be (re-)used for the drawable. This is useful if the transform should have a parent.

xmin: float.

Lower bound in the X dimension for array fields of scalars or vectors.

xmax: float.

Upper bound in the X dimension for array fields of scalars or vectors.

ymin: float.

Lower bound in the Y dimension for array fields of scalars or vectors.

ymax: float.

Upper bound in the Y dimension for array fields of scalars or vectors.

zmin: float.

Lower bound in the Z dimension for array fields of scalars or vectors.

zmax: float.

Upper bound in the Z dimension for array fields of scalars or vectors.

bounds: array_like.

Array of bounds (bounding box or rectangle) for array fields of scalars or vectors. This array can be of size 6 (xmin, xmax, ymin, ymax, zmin, zmax) for 3D fields, or of size 4 (xmin, xmax, ymin, ymax) for 2D fields. Takes precedence over separate xmin, xmax, … etc. arguments.

translation=kwargs.get(‘translation’), rotation=kwargs.get(‘rotation’), scaling=kwargs.get(‘scaling’), model_matrix

k3d.transform.transform(bounds=None, translation=None, rotation=None, scaling=None, custom_matrix=None, parent=None)[source]

k3d.platonic

class k3d.platonic.Cube(origin=[0, 0, 0], size=1)[source]

Bases: k3d.platonic.PlatonicSolid

Create a cube.

Arguments:
origin: array_like.

The position of centroid of the solid.

size: float.

The size*sqrt(3) is the distance of each vertex from centroid of the solid.

The edge of cube is 2*size.

class k3d.platonic.Dodecahedron(origin=[0, 0, 0], size=1)[source]

Bases: k3d.platonic.PlatonicSolid

Create a dodecahedron solid.

Arguments:
origin: array_like.

The position of centroid of the solid.

size: float.

The size*sqrt(3) is the distance of each vertex of the solid.

class k3d.platonic.Icosahedron(origin=[0, 0, 0], size=1)[source]

Bases: k3d.platonic.PlatonicSolid

Create a icosahedron solid.

Arguments:
origin: array_like.

The position of centroid of the solid.

size: float.

The size of the solid.

class k3d.platonic.Octahedron(origin=[0, 0, 0], size=1)[source]

Bases: k3d.platonic.PlatonicSolid

Create a octahedron solid.

Arguments:
origin: array_like.

The position of centroid of the solid.

size: float.

The distance of each vertex from centroid of the solid.

class k3d.platonic.PlatonicSolid[source]

Bases: object

Base class for platonic solids.

property mesh

Return k3d.mesh object of the solid.

property points

Return k3d.points object of solid vertices.

class k3d.platonic.Tetrahedron(origin=[0, 0, 0], size=1)[source]

Bases: k3d.platonic.PlatonicSolid

Create a tetrahedron solid.

Arguments:
origin: array_like.

The position of centroid of the solid.

size: float.

The size*sqrt(3) is distance of each vertex of the solid.

Module contents