Cone tips do not point at the correct positions
Personne n'a encore pris cette issue.
- Langage dominant
- JavaScript
- Étoiles
- 18.3k
- Forks
- 2k
- Merge moyen
- 2 j 12 h
- PR mergées (30 j)
- 28
Description
In the following, each of two vectors ends at the start of the next one. Tweaking the length of the cones in any way suited to examining them visually, they clearly do not point at the base of their successor cone as (naively?) expected. At least if we expect that the bases of the cones are centered to the start point of the vector it is representing.
import plotly.graph_objs as go
from numpy import array
points = [
[array([-0.03620968, 0.24876811, 5.51279187]), array([1.39049627, 0.57429448, 4.67921793])],
[array([1.39049627, 0.57429448, 4.67921793]), array([2.02424265, -0.15235655, 2.63707954])],
[array([ 2.02424265, -0.15235655, 2.63707954]), array([ 3.68335955, -1.14431782, 1.09909298])]
]
cone_traces = []
for pair in points:
start_point = pair[0]
end_point = pair[1]
vector = end_point - start_point
# a partial workaround to scale the vectors more or less to their actual length, which
# plottly does not allow fully controlling: https://github.com/plotly/plotly.js/issues/3613
scaled_vector = vector * 1.5
start_x, start_y, start_z = start_point[0], start_point[1], start_point[2]
end_x, end_y, end_z = end_point[0], end_point[1], end_point[2]
trace = go.Cone(
x=[start_x],
y=[start_y],
z=[start_z],
u=[scaled_vector[0]],
v=[scaled_vector[1]],
w=[scaled_vector[2]])
cone_traces.append(trace)
layout = go.Layout(
scene=dict(
camera=dict(
# set the virtual point of view to point to the origin
center=dict(x=0, y=0, z=0),
# set the virtual point of view to be positioned parallel to the depth axis, at a distance
# sufficently away from the vectors to see them all; although plotly won't fully respect the
# angle this eye position should make, https://stackoverflow.com/q/76q921229/1509695,
# it will be very very close to that, and the chart user can nudge the tilt to
# perfect the viewing angle.
eye=dict(x=0, y=0, z=-3))))
fig = go.Figure(data=cone_traces, layout=layout)
fig.show()
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Reproduisez l’exemple Python go.Cone fourni, en faisant varier la longueur du cône et les paramètres de la caméra afin de confirmer la divergence de position. Suivez le comportement de rendu des cônes 3D correspondant dans plotly.js et ajoutez une vérification de régression pour vérifier que les bases des cônes s’alignent sur les points de départ des vecteurs fournis ; cela est terminé lorsque les cônes pointent vers les positions successeures attendues.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript, python
- Domaine
- data-visualization
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100