A program to write Lattice Hinge with Rhinoceros with Python

How to use

  1. Download drawlatticehinge.py (https://github.com/drleonardo1010/drawLatticeHinge "Download")
  2. Save drawlatticehinge.py in the same main program and in the same directory
  3. Import drawlatticehinge.py in the main program
  4. Set parameters and draw with draw_lattice_follow_crosspoint

Sample program

SampleProgram.py



import rhinoscriptsyntax as rs
import drawlatticehinge as lh
import math

def clear_all():
    all_obs = rs.ObjectsByType(0)
    rs.DeleteObjects(all_obs)

clear_all()

parameter = [37.5,0.2,0.4,1.5,10]
lattice = lh.LatticeHinge(parameter)

startPoint = (0,0,0)
endPoint = (200,200,0)

lattice.draw_lattice_follow_crosspoint(startPoint,endPoint)

Parameters

image.png

parameter = [37.5,0.2,0.4,1.5,10]

LINE_LENGTH = parameter[0] #37.5#
LINE_WIDTH = parameter[1] #0.2#
OVERLAP_RATE = parameter[2] #0.4#
LINE_INTERVAL = parameter[3] #1.5#
INTERVAL_LIMIT = parameter[4] #10#
cutAngle = (math.radians(90),math.radians(90),math.radians(90),math.radians(90))

※comment LINE_LENGTH = length of one line LINE_WIDTH = width of one line (0.2mm because it is the cut width of the laser) OVERLAP_RATE = Overlapping line lengths LINE_INTERVAL = Line-to-line spacing INTERVAL_LIMIT = Lattice repeat count (this number determines the width and number of lattices)

Execution result

image.png

Lattice Hinge was drawn between startPoint = (0,0,0) and endPoint = (200,200,0)

Recommended Posts

A program to write Lattice Hinge with Rhinoceros with Python
I want to write to a file with Python
Write to csv with Python
From buying a computer to running a program with python
[Python] A memo to write CSV vertically with Pandas
How to write a Python class
[Python] Write to csv file with Python
Write a batch script with Python3.5 ~
How to batch start a python program created with Jupyter notebook
[Python] A program that creates stairs with #
Write a TCP client with Python Twisted
I tried to create a program to convert hexadecimal numbers to decimal numbers with python
[Introduction to Python] How to write a character string with the format function
How to read a CSV file with Python 2/3
Send a message to LINE with Python (LINE Notify)
Try to draw a life curve with python
I want to make a game with Python
[Write to map with plotly] Dynamic visualization with plotly [python]
Decide to assign a laboratory with Python (fiction)
Why does Python have to write a colon?
Steps to create a Twitter bot with python
Let's write a Python program and run it
Try to make a dihedral group with Python
Write CSV data to AWS-S3 with AWS-Lambda + Python
A layman wants to get started with Python
Searching for an efficient way to write a Dockerfile in Python with poetry
How to convert / restore a string with [] in python
A memo connected to HiveServer2 of EMR with python
Write a super simple molecular dynamics program in python
[Python] How to draw a line graph with Matplotlib
Try to make a command standby tool with python
Python Ver. To introduce WebPay with a little code.
I tried to draw a route map with Python
I want to write in Python! (2) Let's write a test
How to write a list / dictionary type of Python3
Try embedding Python in a C ++ program with pybind11
Write multiple records to DynamoDB with Lambda (Python, JavaScript)
[Python] How to write a docstring that conforms to PEP8
For those who want to write Python with vim
Write code to Unit Test a Python web app
[Python] How to create a 2D histogram with Matplotlib
[Python] Create a Tkinter program distribution file with cx_Freeze
Using a Python program with fluentd's exec_filter Output Plugin
I want to run a quantum computer with Python
[Python] How to draw a scatter plot with Matplotlib
[Python] Road to a snake charmer (5) Play with Matplotlib
Using a python program with fluentd's exec Output Plugin
I made a program to convert images into ASCII art with Python and OpenCV
A road to intermediate Python
Connect to Wikipedia with Python
Post to slack with Python 3
Make a fortune with Python
Let's write python with cinema4d.
Switch python to 2.7 with alternatives
Create a directory with python
How to install NPI + send a message to line with python
How to convert an array to a dictionary with Python [Application]
How to run a Python program from within a shell script
Create a Mastodon bot with a function to automatically reply with Python
I made a package to filter time series with python
A collection of competitive pro techniques to solve with Python