blend.comp
来自「CNC 的开放码,EMC2 V2.2.8版」· COMP 代码 · 共 37 行
COMP
37 行
// This is a component for EMC2 HAL// Copyright 2006 Jeff Epler <jepler@unpythonic.net>//// This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the// GNU General Public License for more details.//// You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USAcomponent blend "Perform linear interpolation between two values";pin in float in1 "First input. If select is equal to 0.0, the output is equal to in1";pin in float in2 "Second input. If select is equal to 1.0, the output is equal to in2";pin in float select "Select input. For values between 0.0 and 1.0, the output changes linearly from in1 to in2";pin out float out "Output value.";param rw bit open "If true, select values outside the range 0.0 to 1.0 give values outside the range in1 to in2. If false, outputs are clamped to the the range in1 to in2";function _;license "GPL";;;FUNCTION(_) { double select_ = select; if(!open) { if(select_ < 0) select_ = 0; if(select_ > 1) select_ = 1; } out = in1 * select_ + in2 * (1 - select_);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?