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
# Compute the key dimensions of the flattened surface of a truncated cone | |
# Use the cone height H, large diameter L and small diamater D to calculate the | |
# ring sector that wraps around it, given by the parameters: | |
# P (inner radius), Q (outer radius) and alpha (sector angle) | |
# check out https://www.templatemaker.nl/en/cone/ | |
# Need to install https://imagemagick.org/ CLI | |
# Consider using wand (https://github.com/emcconville/wand) for a | |
# more "pythonic" interface |
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
# Read the details about this on www.makerluis.com/getting-the-size-of-3d-print-from-gcode | |
def get_max_size(text): | |
pattern_xy= 'G1.X(\d*.\d*).Y(\d*.\d*).E\d*.\d*.;.perimeter' | |
pattern_z = 'G1.Z(\d*.\d*).F\d*.\d*.;.restore.layer.Z' | |
pattern_width = ';TYPE:Perimeter\n;WIDTH:(\d*.\d*).' | |
matches_xy = re.findall(pattern_xy, text) | |
x = list(list(zip(*matches_xy))[0]) | |
y = list(list(zip(*matches_xy))[1]) |
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
# %% Import libraries | |
import os | |
import tkinter as tk | |
from tkinter import filedialog | |
import re | |
class App(tk.Frame): | |
def __init__(self, master): |
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
function sl_customization(cm) | |
cm.addCustomMenuFcn('Simulink:ToolsMenu', @getMyMenuItems); | |
end | |
function schemaFcns = getMyMenuItems(~) | |
schemaFcns = {@autoAddBlocks}; | |
end | |
function schema = autoAddBlocks(~) |
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
subsystem = gcs; | |
goto_objects = Simulink.findBlocksOfType(selection, 'Goto', 'Selected', 'on'); | |
for i_block = 1:numel(goto_objects) | |
tag = get_param(goto_objects(i_block), 'Gototag'); | |
origin_position = get_param(goto_objects(i_block), 'Position'); | |
dest_block = [subsystem '/Goto']; | |
dest_position = origin_position + [200 0 200 0]; | |
handle = add_block('built-in/from', dest_block, 'MakeNameUnique','on'); | |
set_param(handle, 'Gototag', tag, 'Position', dest_position); |
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
subsystem = gcs; % Get current system | |
objects = gsb; % Get selected blocks | |
% Alternative: find_system(gcs,'Selected','on') | |
for i_block = 1:numel(objects) | |
% Add Outports and connected lines for From blocks | |
if strcmp(get_param(objects{i_block}, 'BlockType'), 'From') | |
% Get the tag and position of the From block | |
tag = get_param(objects{i_block}, 'Gototag'); |
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
#include <Mouse.h> | |
#include <Keyboard.h> | |
// Defining each pin, with a unique name | |
#define KEY0 0 | |
#define KEY1 1 | |
#define KEY2 2 | |
#define KEY3 3 | |
#define KEY4 4 |
This file has been truncated, but you can view the full file.
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
<html> | |
<head><meta charset="utf-8" /></head> | |
<body> | |
<script type="text/javascript">!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}((function(){return function t(e,r,n){function i(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,(function(t){return i(e[o][1][t]||t)}),u,u.exports,t,e,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(t,e,r){"use strict";var n=t("plotly.js/src/components/annotations"),i=t("plotly.js");n.add=function(t){var e=t._fullLayout.annotations.length;i.relayout(t,"annotations["+e+"]","ad |
This file has been truncated, but you can view the full file.
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
<html> | |
<head><meta charset="utf-8" /></head> | |
<body> | |
<div> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script> | |
<script type="text/javascript">/** | |
* plotly.js v2.14.0 | |
* Copyright 2012-2022, Plotly, Inc. | |
* All rights reserved. | |
* Licensed under the MIT license | |
*/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder