-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f27e9b1
commit 55c75ee
Showing
22 changed files
with
180 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,125 +1,20 @@ | ||
# type: ignore | ||
|
||
# import compas | ||
from compas.datastructures import Mesh | ||
from compas_view2.app import App | ||
from compas.colors import Color | ||
from compas.geometry import Circle | ||
from compas_view2.objects import Text | ||
|
||
# mesh = Mesh.from_obj(compas.get("tubemesh.obj")) | ||
|
||
# viewer = App(width=1600, height=900) | ||
# viewer.add(mesh) | ||
# viewer.view.camera.position = [1, -6, 1.5] | ||
# viewer.view.camera.look_at([1, 0, 1]) | ||
# viewer.run() | ||
|
||
# mesh = Mesh.from_meshgrid(dx=9, nx=9) | ||
|
||
# viewer = App(viewport="top", width=1600, height=900) | ||
|
||
# viewer.add(mesh) | ||
# for vertex in range(30, 40): | ||
# color = (1.0, 0.0, 0.0) if mesh.is_vertex_on_boundary(vertex) else (0.0, 0.0, 0.0) | ||
# viewer.add(mesh.vertex_point(vertex), pointsize=20, pointcolor=color) | ||
|
||
# viewer.view.camera.zoom_extents() | ||
# viewer.view.camera.distance = 11 | ||
# viewer.run() | ||
|
||
# mesh = Mesh.from_meshgrid(dx=9, nx=9) | ||
|
||
# viewer = App(viewport="top", width=1600, height=900) | ||
|
||
# red = Color.red() | ||
|
||
# viewer.add(mesh, facecolor=(0.95, 0.95, 0.95), linewidth=2) | ||
# viewer.add( | ||
# Circle.from_point_and_radius(mesh.vertex_point(23) + [0, 0, 0.1], 0.1).to_polygon(100), | ||
# facecolor=(1.0, 1.0, 1.0), | ||
# linecolor=(0.0, 0.0, 0.0), | ||
# linewidth=2, | ||
# ) | ||
|
||
# for i, nbr in enumerate(mesh.vertex_neighbors(23, True)): | ||
# print(nbr) | ||
# viewer.add( | ||
# Circle.from_point_and_radius(mesh.vertex_point(nbr) + [0, 0, 0.1], 0.2).to_polygon(100), | ||
# facecolor=red.lightened(50), | ||
# linecolor=red, | ||
# ) | ||
# viewer.add( | ||
# Text( | ||
# str(i), | ||
# mesh.vertex_point(nbr) + [0.09, -0.075, 0.1], | ||
# height=50, | ||
# ) | ||
# ) | ||
|
||
# viewer.view.camera.zoom_extents() | ||
# viewer.view.camera.distance = 11 | ||
# viewer.run() | ||
from compas_viewer import Viewer | ||
|
||
# mesh = Mesh.from_meshgrid(dx=9, nx=9) | ||
|
||
# viewer = App(viewport="top", width=1600, height=900) | ||
|
||
# red = Color.red() | ||
|
||
# viewer.add( | ||
# Circle.from_point_and_radius(mesh.vertex_point(23) + [0, 0, 0.1], 0.1).to_polygon(100), | ||
# facecolor=(1.0, 1.0, 1.0), | ||
# linecolor=(0.0, 0.0, 0.0), | ||
# linewidth=2, | ||
# ) | ||
|
||
# facecolors = {face: (0.95, 0.95, 0.95) for face in mesh.faces()} | ||
# for i, face in enumerate(mesh.vertex_faces(23)): | ||
# print(face) | ||
# viewer.add( | ||
# Text( | ||
# str(i), | ||
# mesh.face_centroid(face) + [0.09, -0.075, 0.1], | ||
# height=50, | ||
# ) | ||
# ) | ||
# facecolors[face] = red.lightened(50) | ||
|
||
# viewer.add(mesh, facecolor=facecolors, linewidth=2) | ||
|
||
# viewer.view.camera.zoom_extents() | ||
# viewer.view.camera.distance = 11 | ||
# viewer.run() | ||
|
||
# mesh = Mesh.from_meshgrid(dx=9, nx=9) | ||
|
||
# viewer = App(viewport="top", width=1600, height=900) | ||
|
||
# red = Color.red() | ||
|
||
# viewer.add(mesh, facecolor=(0.95, 0.95, 0.95), linewidth=2) | ||
# viewer.add(mesh.edge_line((20, 30)).translated([0, 0, 0.1]), linecolor=red, linewidth=10) | ||
|
||
# for edge in mesh.edge_strip((20, 30)): | ||
# viewer.add(mesh.edge_line(edge).translated([0, 0, 0.1]), linewidth=10) | ||
|
||
# viewer.view.camera.zoom_extents() | ||
# viewer.view.camera.distance = 11 | ||
# viewer.run() | ||
from compas.colors import Color | ||
from compas.datastructures import Mesh | ||
|
||
mesh = Mesh.from_meshgrid(dx=9, nx=9) | ||
|
||
viewer = App(viewport="top", width=1600, height=900) | ||
viewer = Viewer(viewmode="top", width=1600, height=900) | ||
|
||
red = Color.red() | ||
|
||
viewer.add(mesh, facecolor=(0.95, 0.95, 0.95), linewidth=2) | ||
viewer.add(mesh.edge_line((30, 31)).translated([0, 0, 0.1]), linecolor=red, linewidth=10) | ||
viewer.scene.add(mesh, facecolor=(0.95, 0.95, 0.95), lineswidth=2) | ||
viewer.scene.add(mesh.edge_line((30, 31)).translated([0, 0, 0.1]), linecolor=red, lineswidth=10) | ||
|
||
for edge in mesh.edge_loop((30, 31)): | ||
viewer.add(mesh.edge_line(edge).translated([0, 0, 0.1]), linewidth=10) | ||
viewer.scene.add(mesh.edge_line(edge).translated([0, 0, 0.1]), lineswidth=10) | ||
|
||
viewer.view.camera.zoom_extents() | ||
viewer.view.camera.distance = 11 | ||
viewer.run() | ||
viewer.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
# type: ignore | ||
|
||
from compas.geometry import Box, Circle, Frame | ||
from compas.colors import Color, ColorMap | ||
from compas_view2.app import App | ||
from compas_viewer import Viewer | ||
|
||
viewer = App() | ||
viewer.view.show_grid = False | ||
from compas.colors import Color | ||
from compas.geometry import Circle | ||
from compas.geometry import Frame | ||
|
||
viewer.add(Circle(0.4, Frame([0, 0, 0])).to_polygon(n=100), facecolor=Color.red()) | ||
viewer.add(Circle(0.4, Frame([1, 0, 0])).to_polygon(n=100), facecolor=Color.orange()) | ||
viewer.add(Circle(0.4, Frame([2, 0, 0])).to_polygon(n=100), facecolor=Color.yellow()) | ||
viewer.add(Circle(0.4, Frame([3, 0, 0])).to_polygon(n=100), facecolor=Color.lime()) | ||
viewer.add(Circle(0.4, Frame([4, 0, 0])).to_polygon(n=100), facecolor=Color.green()) | ||
viewer.add(Circle(0.4, Frame([5, 0, 0])).to_polygon(n=100), facecolor=Color.mint()) | ||
viewer.add(Circle(0.4, Frame([6, 0, 0])).to_polygon(n=100), facecolor=Color.cyan()) | ||
viewer.add(Circle(0.4, Frame([7, 0, 0])).to_polygon(n=100), facecolor=Color.azure()) | ||
viewer.add(Circle(0.4, Frame([8, 0, 0])).to_polygon(n=100), facecolor=Color.blue()) | ||
viewer.add(Circle(0.4, Frame([9, 0, 0])).to_polygon(n=100), facecolor=Color.violet()) | ||
viewer.add(Circle(0.4, Frame([10, 0, 0])).to_polygon(n=100), facecolor=Color.magenta()) | ||
viewer.add(Circle(0.4, Frame([11, 0, 0])).to_polygon(n=100), facecolor=Color.pink()) | ||
viewer.add(Circle(0.4, Frame([12, 0, 0])).to_polygon(n=100), facecolor=Color.red()) | ||
viewer = Viewer(show_grid=False) | ||
|
||
viewer.run() | ||
viewer.scene.add(Circle(0.4, Frame([0, 0, 0])), linecolor=Color.red(), n=100) | ||
viewer.scene.add(Circle(0.4, Frame([1, 0, 0])), linecolor=Color.orange(), n=100) | ||
viewer.scene.add(Circle(0.4, Frame([2, 0, 0])), linecolor=Color.yellow(), n=100) | ||
viewer.scene.add(Circle(0.4, Frame([3, 0, 0])), linecolor=Color.lime(), n=100) | ||
viewer.scene.add(Circle(0.4, Frame([4, 0, 0])), linecolor=Color.green(), n=100) | ||
viewer.scene.add(Circle(0.4, Frame([5, 0, 0])), linecolor=Color.mint(), n=100) | ||
viewer.scene.add(Circle(0.4, Frame([6, 0, 0])), linecolor=Color.cyan(), n=100) | ||
viewer.scene.add(Circle(0.4, Frame([7, 0, 0])), linecolor=Color.azure(), n=100) | ||
viewer.scene.add(Circle(0.4, Frame([8, 0, 0])), linecolor=Color.blue(), n=100) | ||
viewer.scene.add(Circle(0.4, Frame([9, 0, 0])), linecolor=Color.violet(), n=100) | ||
viewer.scene.add(Circle(0.4, Frame([10, 0, 0])), linecolor=Color.magenta(), n=100) | ||
viewer.scene.add(Circle(0.4, Frame([11, 0, 0])), linecolor=Color.pink(), n=100) | ||
viewer.scene.add(Circle(0.4, Frame([12, 0, 0])), linecolor=Color.red(), n=100) | ||
|
||
viewer.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.