OpenSCAD 基础教程

OpenSCAD 基础教程

文章目录

      • OpenSCAD 基础教程
        • 1. 引言
        • 2. 安装与设置
        • 3. OpenSCAD 基本概念与语法
          • 3.1 基础形状
          • 3.2 变换操作
          • 3.4 布尔运算
          • 3.4 控制流
          • 3.5 特殊功能
        • 4. 实践案例:创建一个简单的机械部件
        • 5. 高级技巧
        • 6. 导出与3D打印
        • 7. 常见问题与解决方案
        • 8. 结语

1. 引言
  • 什么是OpenSCAD?
    • OpenSCAD是一款用于创建3D CAD模型的软件,专注于编写脚本来描述模型,而不是通过交互式界面来构建模型。
    • 它适合程序员或有编程背景的人,因为模型是通过编写代码生成的。
  • OpenSCAD的应用场景
    • 主要用于机械设计、3D打印、建筑模型和教育等领域。
2. 安装与设置
  • 安装OpenSCAD

    • 访问OpenSCAD官网 (https://www.openscad.org/downloads.html),根据你的操作系统下载相应的安装包。
    • 按照安装提示完成软件安装。
  • 界面介绍

    • 代码编辑窗口: 在这里编写和修改代码。

    • 预览窗口: 显示你编写代码生成的3D模型。

    • 控制台: 显示错误信息和调试信息。

    • 工具栏: 包含常用操作按钮,如预览、渲染、导出等。

      1

3. OpenSCAD 基本概念与语法
3.1 基础形状
  • 立方体 (cube)

    cube([width, depth, height]);
    

    创建一个指定尺寸的立方体,默认从原点出发,边长为widthdepthheight

    //创建一个长宽高各为10的正立方体。
    cube(10);
    

    2

    //创建一个长为10,高为20的立方柱。
    cube([10,10,20]);
    

    3

  • 球体 (sphere)

    sphere(r=radius);
    

    创建一个指定半径radius的球体。

    //创建一个半径为5的球体
    sphere(r = 5);
    

    4

  • 圆柱体 (cylinder)

    cylinder(h=height, r=radius);
    

    创建一个指定高度height和底面半径radius的圆柱体。

    //创建一个指定高度20和底面半径5的圆柱体
    cylinder(h = 20, r = 5);
    

    5

  • 圆锥体 (cylinder with r1 and r2)

    cylinder(h=height, r1=bottom_radius, r2=top_radius);
    

    创建一个高度为height的圆锥体或截头圆锥体,底部半径为r1,顶部半径为r2

    //创建一个高度为20的圆锥体,底部半径为5。
    cylinder(h = 20, r1 = 5, r2 = 0);
    

    6

  • 环面 (torus)

    module torus(R = 20, r = 5) 
    {
        rotate_extrude(angle = 360)
        translate([R, 0, 0])
        circle(r);
    }
    
    // 示例: 创建一个大半径为 20,小半径为 5 的环面
    torus(R = 20, r = 5);
    

    7

    使用 rotate_extrudetranslate 函数结合来创建一个环面。

    1. circle(r):
      • 创建一个半径为 r 的圆。这将成为环面截面的形状。
    2. translate([R, 0, 0]):
      • 将圆形沿着 X 轴平移 R 单位。这个平移将确定环面的大半径。
    3. rotate_extrude(angle = 360):
      • 将被平移的圆围绕 Z 轴旋转 360 度,从而生成一个环面。
  • 参数说明

    • R: 环面的大半径,即圆心到环面中心轴的距离。
    • r: 环面的小半径,即圆的半径。

    通过调整 Rr 参数,你可以生成不同大小和形状的环面。

  • 可选项

    如果你想生成部分环面,可以调整 rotate_extrudeangle 参数,例如:

    rotate_extrude(angle = 180)  // 生成半个环面
    

    这段代码会生成一个半环面。

3.2 变换操作
  • 平移 (translate)

    translate([x, y, z]) 
    {
        // 你的模型
    }
    

    平移模型至指定的x, y, z位置。

    module torus(R = 20, r = 5) 
    {
        rotate_extrude(angle = 360)
        translate([R, 0, 0])
        circle(r);
    }
    
    translate([0, 0, 0])   cube(10);
    translate([20, 0, 0])  cube([10,10,20]);
    translate([40, 0, 0])  sphere(r = 5);
    translate([60, 0, 0])  cylinder(h = 20, r = 5); 
    translate([80, 0, 0])  cylinder(h = 20, r1 = 5, r2 = 0);
    translate([120, 0, 0])  torus(R = 20, r = 5);
    

    8

  • 旋转 (rotate)

    rotate([x_angle, y_angle, z_angle]) 
    {
        // 你的模型
    }
    

    围绕x, y, z轴按指定角度旋转模型。

    module torus(R = 20, r = 5) 
    {
        rotate_extrude(angle = 360)
        translate([R, 0, 0])
        circle(r);
    }
    
    rotate([0,30,0])  translate([0, 0, 0])   cube(10);
    rotate([0,60,0]) translate([20, 0, 0])  cube([10,10,20]);
    rotate([0,90,0]) translate([40, 0, 0])  sphere(r = 5);
    rotate([0,120,0]) translate([60, 0, 0])  cylinder(h = 20, r = 5); 
    rotate([0,150,0]) translate([80, 0, 0])  cylinder(h = 20, r1 = 5, r2 = 0);
    rotate([0,180,0]) translate([120, 0, 0])  torus(R = 20, r = 5);
    

    9

  • 缩放 (scale)

    scale([x_factor, y_factor, z_factor]) 
    {
        // 你的模型
    }
    

    x, y, z方向缩放模型。

    module torus(R = 20, r = 5) 
    {
        rotate_extrude(angle = 360)
        translate([R, 0, 0])
        circle(r);
    }
    
    scale([0.5,1,1])  translate([0, 0, 0])   cube(10);
    scale([1,0.5,1]) translate([20, 0, 0])  cube([10,10,20]);
    scale([1,1,0.5]) translate([40, 0, 0])  sphere(r = 5);
    scale([2,1,1]) translate([60, 0, 0])  cylinder(h = 20, r = 5); 
    scale([1,2,1]) translate([80, 0, 0])  cylinder(h = 20, r1 = 5, r2 = 0);
    scale([1,1,2]) translate([120, 0, 0])  torus(R = 20, r = 5);
    

    10

  • 镜像 (mirror)

    mirror([x, y, z]) 
    {
        // 你的模型
    }
    

    对模型进行镜像操作。镜像平面由向量[x, y, z]确定。

    module torus(R = 20, r = 5) 
    {
        rotate_extrude(angle = 360)
        translate([R, 0, 0])
        circle(r);
    }
    
    mirror([0,0,0])  translate([0, 0, 0])   cube(10);
    mirror([1,0,0]) translate([20, 0, 0])  cube([10,10,20]);
    mirror([0,1,0]) translate([40, 0, 0])  sphere(r = 5);
    mirror([0,0,1]) translate([60, 0, 0])  cylinder(h = 20, r = 5); 
    mirror([0,1,1]) translate([80, 0, 0])  cylinder(h = 20, r1 = 5, r2 = 0);
    mirror([1,1,0]) translate([120, 0, 0])  torus(R = 20, r = 5);
    

    11

  • 线性放样 (linear_extrude)

    linear_extrude(height) 
    {
        // 2D形状
    }
    

    对2D形状进行线性拉伸生成3D模型。

    // 圆形 -> 圆柱体
    module circle3D(radius = 10, height = 5) 
    {
        cylinder(r=radius, h=height);
    }
    
    // 半圆 -> 半圆柱体
    module semiCircle3D(radius = 10, height = 5) 
    {
        translate([-radius, 0, 0])
        linear_extrude(height=height)
            intersection() 
            {
                circle(r=radius);
                square([2*radius, radius]);
            }
    }
    
    // 方形 -> 立方体
    module square3D(size = [10, 10], height = 5) 
    {
        linear_extrude(height=height)
            square(size);
    }
    
    // 三角形 -> 三棱柱
    module triangle3D(base = 10, height = 10, prismHeight = 5) 
    {
        linear_extrude(height=prismHeight)
            polygon(points=[[0,0], [base, 0], [base/2, height]]);
    }
    
    // 长方形 -> 长方体
    module rectangle3D(size = [10, 20], height = 5) 
    {
        linear_extrude(height=height)
            square(size);
    }
    
    // 菱形 -> 菱形棱柱
    module rhombus3D(diagonal1 = 15, diagonal2 = 10, height = 5) 
    {
        linear_extrude(height=height)
            polygon(points=[[0, diagonal2/2], [diagonal1/2, 0], [0, -diagonal2/2], [-diagonal1/2, 0]]);
    }
    
    // 五边形 -> 五棱柱
    module pentagon3D(side = 10, height = 5) 
    {
         // 五边形的顶点坐标
        points = 
        [
            [side * cos(0), side * sin(0)], 
            [side * cos(72), side * sin(72)], 
            [side * cos(144), side * sin(144)], 
            [side * cos(-144), side * sin(-144)], 
            [side * cos(-72), side * sin(-72)]
        ];
        
        // 生成五棱柱
        linear_extrude(height=height)
            polygon(points);
    }
    
    // 六边形 -> 六棱柱
    module hexagon3D(side = 10, height = 5) 
    {
        points = 
        [
            [side * cos(0), side * sin(0)], 
            [side * cos(60), side * sin(60)], 
            [side * cos(120), side * sin(120)], 
            [side * cos(180), side * sin(180)], 
            [side * cos(240), side * sin(240)], 
            [side * cos(300), side * sin(300)]
        ];
        
          // 生成六棱柱
        linear_extrude(height=height)
            polygon(points);
    }
    
    // 七边形 -> 七棱柱
    module heptagon3D(side = 10, height = 5) 
    {
          // 七边形的顶点坐标
        points = 
        [
            [side * cos(0), side * sin(0)], 
            [side * cos(51.43), side * sin(51.43)], 
            [side * cos(102.86), side * sin(102.86)], 
            [side * cos(154.29), side * sin(154.29)], 
            [side * cos(205.71), side * sin(205.71)], 
            [side * cos(257.14), side * sin(257.14)], 
            [side * cos(308.57), side * sin(308.57)]
        ];
        
        // 生成七棱柱
        linear_extrude(height=height)
            polygon(points);
    }
    
    // 圆锥形 -> 圆锥体
    module cone3D(radius = 10, height = 15) 
    {
        cylinder(r1=radius, r2=0, h=height);
    }
    
    // 圆柱形 -> 圆柱体
    module cylinder3D(radius = 10, height = 15) 
    {
        cylinder(r=radius, h=height);
    }
    
    // 梯形 -> 梯形棱柱
    module trapezoid3D(top_width = 15, bottom_width = 25, height = 10, prismHeight = 5) 
    {
        linear_extrude(height=prismHeight)
            polygon(points=[[0,0], [bottom_width,0], [top_width, height], [0, height]]);
    }
    
    // 平行四边形 -> 平行四边形棱柱
    module parallelogram3D(base = 20, side = 10, height = 5) 
    {
        linear_extrude(height=height)
            polygon(points=[[0,0], [base, 0], [base + side, height], [side, height]]);
    }
    
    // 金字塔形 -> 四棱锥
    module pyramid3D(base = 20, height = 10) 
    {
        polyhedron(
            points=[[0,0,0], [base,0,0], [base,base,0], [0,base,0], [base/2,base/2,height]],
            faces=[[0,1,4], [1,2,4], [2,3,4], [3,0,4], [0,1,2,3]]
        );
    }
    
    
    
    
    // 测试和展示所有形状
    module Shape3D()
    {
        translate([0, 0, 0])    circle3D(10, 5);
        translate([25, 0, 0])   semiCircle3D(10, 5);
        translate([50, 0, 0])   square3D([10, 10], 5);
        translate([75, 0, 0])   triangle3D(10, 10, 5);
        translate([100, 0, 0])  rectangle3D([10, 20], 5);
        translate([125, 0, 0])  rhombus3D(15, 10, 5);
        translate([150, 0, 0])  pentagon3D(10, 5);
        translate([175, 0, 0])  hexagon3D(10, 5);
        translate([200, 0, 0])  heptagon3D(10, 5);
        translate([225, 0, 0])  cone3D(10, 15);
        translate([250, 0, 0])  cylinder3D(10, 15);
        translate([275, 0, 0])  trapezoid3D(15, 25, 10, 5);
        translate([320, 0, 0])  parallelogram3D(20, 10, 5);
        translate([360, 0, 0])  pyramid3D(20, 10);
    }
    Shape3D();
    

    12

    自定义形状

    // 三角形
    module triangle(base = 10, height = 10) 
    {
        points = 
        [
            [0,0], 
            [base, 0],
            [base/2, height]
        ];
        
        polygon(points);
    }
    
    // 长方形
    module rectangle(size = [10, 20]) 
    {
        square(size);
    }
    
    // 菱形
    module rhombus(diagonal1 = 15, diagonal2 = 10) 
    {
        points = 
        [
            [0, diagonal2/2], 
            [diagonal1/2, 0],
            [0, -diagonal2/2],
            [-diagonal1/2, 0]
        ];
        polygon(points);
    }
    
    // 五边形
    module pentagon(side = 10) 
    {
         // 五边形的顶点坐标
        points = 
        [
            [side * cos(0), side * sin(0)], 
            [side * cos(72), side * sin(72)], 
            [side * cos(144), side * sin(144)], 
            [side * cos(-144), side * sin(-144)], 
            [side * cos(-72), side * sin(-72)]
        ];
        polygon(points);
    }
    
    // 六边形
    module hexagon(side = 10) 
    {
        points = 
        [
            [side * cos(0), side * sin(0)], 
            [side * cos(60), side * sin(60)], 
            [side * cos(120), side * sin(120)], 
            [side * cos(180), side * sin(180)], 
            [side * cos(240), side * sin(240)], 
            [side * cos(300), side * sin(300)]
        ];
        
        polygon(points);
    }
    
    // 七边形
    module heptagon(side = 10) 
    {
          // 七边形的顶点坐标
        points = 
        [
            [side * cos(0), side * sin(0)], 
            [side * cos(51.43), side * sin(51.43)], 
            [side * cos(102.86), side * sin(102.86)], 
            [side * cos(154.29), side * sin(154.29)], 
            [side * cos(205.71), side * sin(205.71)], 
            [side * cos(257.14), side * sin(257.14)], 
            [side * cos(308.57), side * sin(308.57)]
        ];
        
        polygon(points);
    }
     
    // 梯形
    module trapezoid(top_width = 15, bottom_width = 25, height = 10) 
    {
        points = 
        [
            [0,0], 
            [bottom_width,0],
            [top_width, height],
            [0, height]
        ];
        polygon(points);
    }
    
    // 平行四边形
    module parallelogram(base = 20, side = 10, height = 5) 
    {
        points =
        [
            [0,0],
            [base, 0],
            [base + side, height],
            [side, height]
        ];
        polygon(points);
    }
    
     
     
    
    // 测试和展示所有形状
    module Shape3D()
    {
        translate([0, 0, 0])  linear_extrude(height = 5) triangle(10, 10);
        translate([25, 0, 0]) linear_extrude(height = 5) rectangle([10, 20]);
        translate([50, 0, 0]) linear_extrude(height = 5) rhombus(15, 10);
        translate([75, 0, 0]) linear_extrude(height = 5) pentagon(10);
        translate([100, 0, 0]) linear_extrude(height = 5) hexagon(10);
        translate([125, 0, 0]) linear_extrude(height = 5) heptagon(10);
        translate([150, 0, 0]) linear_extrude(height = 5)  trapezoid(15, 25, 10);
        translate([200, 0, 0]) linear_extrude(height = 5)  parallelogram(20, 10);
      
    }
    Shape3D();
    

    14

  • 旋转放样 (rotate_extrude)

    rotate_extrude(angle=360) 
    {
        // 2D形状
    }
    

    通过围绕一个轴旋转2D形状生成3D模型,angle指定旋转角度。

      //创建一个方面环
      translate([0,0,0])
        rotate_extrude(angle = 360)
            translate([40, 0, 0])
            square(10);
       
      //创建一个圆面环
      translate([0,0,15])
        rotate_extrude(angle = 360)
            translate([20, 0, 0])
            circle(5);
    

    13

3.4 布尔运算
  • 联合 (union)

    union() 
    {
        // 模型1
        // 模型2
    }
    

    将多个模型合并成一个整体。

  • 差集 (difference)

    difference() 
    {
        // 模型1
        // 模型2
    }
    

    从第一个模型中减去其他模型。

  • 交集 (intersection)

    intersection() 
    {
        // 模型1
        // 模型2
    }
    

    取多个模型的交集部分。

3.4 控制流
  • 模块 (module)

    module moduleName() 
    {
        // 模型定义
    }
    moduleName();
    

    定义一个模块,以便重复使用该模型。

  • 变量与赋值 (=)

    size = 10;
    cube([size, size, size]);
    

    使用变量来存储和复用值。

  • 条件语句 (if)

    if (condition) 
    {
        // 条件为真时的模型
    } 
    else 
    {
        // 条件为假时的模型
    }
    

    根据条件生成不同的模型。

  • 循环 (for)

    for (i = [start : step : end]) 
    {
        // 根据`i`生成的模型
    }
    

    用于生成重复结构,例如排列一系列模型。

  • 生成器 (children)

    module wrapper() 
    {
        translate([x, y, z])
        children();
    }
    wrapper() 
    {
        // 子模型
    }
    

    创建一个可以处理子模块的模块。

3.5 特殊功能
  • 颜色 (color)

    color("red") 
    {
        // 模型
    }
    

    为模型添加颜色,颜色名称可用字符串或RGB值表示。

  • 透明度 (alpha)

    color([r, g, b, alpha]) 
    {
        // 模型
    }
    

    为模型设置透明度,alpha值在0到1之间。

  • 多面体 (polyhedron)

    polyhedron(points=[...], faces=[...]);
    

    使用顶点和面定义一个多面体。

  • 文本 (text)

    text("Hello", size=10, font="Arial", valign="center");
    

    生成文本,文本可以通过linear_extruderotate_extrude生成3D效果。

4. 实践案例:创建一个简单的机械部件
  • 案例描述: 创建一个带有圆孔的方块。

  • 步骤

    1. 创建一个立方体:cube([20, 20, 20]);

    2. 在立方体上钻一个圆孔:

      difference() 
      {
          cube([20, 20, 20]);
          translate([10, 10, 0])
          cylinder(h=20, r=5);
      }
      
    3. 渲染模型并查看结果。

5. 高级技巧
  • 变量与参数化设计

    • 通过变量控制模型尺寸,使模型更具灵活性。

    • 例如:

      size = 20;
      cube([size, size, size]);
      
  • 条件语句

    • 使用

      if
      

      语句来控制模型的生成:

      if (condition) 
      {
          // 生成模型A
      } 
      else 
      {
          // 生成模型B
      }
      
  • 循环

    • 使用

      for
      

      循环创建重复结构:

      for (i = [0 : 10]) 
      {
          translate([i*2, 0, 0]) cube([1, 1, 1]);
      }
      
  • 模块外部调用

  1. use 指令
    • use 用于引入外部文件中的模块和函数,但不会立即执行该文件中的代码。只会将文件中的模块和函数加载到当前文件中供使用。
  2. include 指令
    • include 也用于引入外部文件中的模块和函数,但与 use 不同,它会立即执行该文件中的所有代码。

示例用法

假设你有一个外部文件 shapes.scad,内容如下:

// shapes.scad

module hexagon3D(side = 10, height = 5)
 {
    points = 
    [
        [side * cos(0), side * sin(0)], 
        [side * cos(60), side * sin(60)], 
        [side * cos(120), side * sin(120)], 
        [side * cos(180), side * sin(180)], 
        [side * cos(240), side * sin(240)], 
        [side * cos(300), side * sin(300)]
    ];
    
    linear_extrude(height=height)
        polygon(points);
}

module square3D(size = [10, 10], height = 5)
 {
    linear_extrude(height=height)
        square(size);
}

现在,你可以在另一个 OpenSCAD 文件中使用 useinclude 指令来调用 shapes.scad 文件中的模块:

// main.scad

use <shapes.scad>;

// 调用 hexagon3D 模块
hexagon3D(side = 15, height = 10);

include

// main.scad

include <shapes.scad>;

// 调用 hexagon3D 模块
hexagon3D(side = 15, height = 10);

区别总结

  • 使用 use <file.scad> 时,只加载模块和函数,不执行 file.scad 中的其他代码。
  • 使用 include <file.scad> 时,加载并执行 file.scad 中的所有代码。
6. 导出与3D打印
  • 导出STL文件
    • 渲染模型后,通过菜单 File > Export > Export as STL 导出STL文件。
    • 该文件可以用于3D打印或进一步加工。
7. 常见问题与解决方案
  • 错误调试
    • 如何阅读和理解控制台中的错误信息。
    • 常见错误的解决方法。
  • 优化模型
    • 提升模型生成速度的技巧,如减少不必要的布尔运算、优化代码结构等。
8. 结语
  • 进一步学习资源
    • 官方文档和社区资源链接。
    • 推荐的学习路线。
  • 动手实践的重要性
    • 鼓励读者多动手实践,尝试独立完成一些项目,逐步提高对OpenSCAD的理解和应用能力。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/872169.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

虚拟机的安装-详细教程

目录 新建虚拟机 选择典型 安装操作系统 选择CentOS7 64位版本 虚拟机存放位置 磁盘容量 完成 编辑虚拟机 修改内存大小 设置处理器个数 选择镜像 开启虚拟机 进入界面&#xff0c;回车 选择语言 安装类型 磁盘分区 开启网络 设置密码和用户 重启 接受许可…

python进阶篇-day07-进程与线程

day06进程与线程 一. 进程 每个软件都可以看作是一个进程(数据隔离) 软件内的多个任务可以看作是多个线程(数据共享) 单核CPU: 宏观并行, 微观并发 真正的并行必须有多核CPU 多任务介绍 概述 多任务指的是, 多个任务"同时"执行 目的 节约资源, 充分利用CPU资源, …

unreal engine 5.4.4 runtime 使用PCG

Unreal PCG Runtime runtime环境下控制PCG PCG Graph 这里简单的在landscape上Spawn Static Mesh 和 Spawn Actor GraphSetting 自定义的参数&#xff0c;方便修改 场景 这里新建了一个蓝图Actor PCG_Ctrl, 用来runtime的时候控制PCG生成 Construct 获取场景中的PCGVolum…

开源还是封闭?人工智能的两难选择

这篇文章于 2024 年 7 月 29 日首次出现在 The New Stack 上。人工智能正处于软件行业的完美风暴中&#xff0c;现在马克扎克伯格 &#xff08;Mark Zuckerberg&#xff09; 正在呼吁开源 AI。 关于如何控制 AI 的三个强大观点正在发生碰撞&#xff1a; 1 . 所有 AI 都应该是开…

易保全出席人工智能应用场景高峰论坛,发布AI-数据资产管理平台2.0应用成果

2024年9月5日&#xff0c;由上海合作组织国家多功能经贸平台、重庆市科技发展基金会指导&#xff0c;重庆市渝中区商务委员会等相关部门主办、华智未来(重庆)科技有限公司承办&#xff0c;重庆民营经济国际合作商会协办的“智驭未来创想无界人工智能应用场景高峰论坛暨成果发布…

区块链-P2P(八)

前言 P2P网络&#xff08;Peer-to-Peer Network&#xff09;是一种点对点的网络结构&#xff0c;它没有中心化的服务器或者管理者&#xff0c;所有节点都是平等的。在P2P网络中&#xff0c;每个节点都可以既是客户端也是服务端&#xff0c;这种网络结构的优点是去中心化、可扩展…

linux(ubuntu)安装QT-ros插件

Linux下的qt安装ros插件 查看qt版本和对应的ros插件版本查看qt版本查看 qt creator 版本 qt creator进行更新升级下载版本对应的ros_qtc_plugin 插件插件安装安装成功 查看qt版本和对应的ros插件版本 想要qt与ros联合开发&#xff0c;我门需要在qt creator中添加ros的插件&…

Docker Hub 仓库国内无法拉取镜像,如何应对?

Docker Hub 仓库国内无法拉取镜像&#xff0c;如何应对? 描述&#xff1a;早上起来发现交流群中有童鞋在说无法在Docker Hub中正常拉取镜像&#xff0c;然后在公司的服务器上拉取最新的nginx:latest镜像发现确实无法拉取。 注册一个阿里云账户 由于前面作者发布过两篇同步国外…

Android平台RTSP|RTMP播放器(SmartPlayer)集成必读

技术背景 好多开发者拿到大牛直播SDK的Android平台RTSP、RTMP播放模块&#xff0c;基本上不看说明&#xff0c;测试后&#xff0c;就直接集成到自己系统了。不得不说&#xff0c;我们的模块虽然接口很多&#xff0c;功能支持全面&#xff0c;但是上层的demo设计逻辑确实简单&a…

安装Android Studio及第一个Android工程可能遇到的问题,gradle下载过慢、sync失败?

Android Studio版本众多&#xff0c;电脑操作系统、电脑型号、电脑硬件也是多种多样&#xff0c;幸运的半个小时内可以完成安装&#xff0c;碰到不兼容的电脑&#xff0c;一天甚至更长时间都无法安装成功。 Android安装及第一个Android工程分为4个步骤&#xff0c;为什么放到一…

echarts进度

echarts图表集 const data[{ value: 10.09,name:制梁进度, color: #86C58C,state: }, { value: 66.00,name:架梁进, color: #C6A381 ,state:正常}, { value: 33.07,name:下部进度, color: #669BDA,state:正常 }, ];// const textStyle { "color": "#CED6C8&…

【whisper】使用whisper实现语音转文字

whisper需要ffmpeg支持 官网下载ffmpeg https://www.gyan.dev/ffmpeg/builds/下载完毕后解压放到合适的位置 添加环境变量 在cmd中输入以下 ffmpeg -version出现下面结果代表成功 安装whisper pip install openai-whisper在vscode中运行 测试代码 import whisperif __n…

SAP 生产订单工序删除状态撤回简介

SAP 生产订单工序删除状态撤回简介 一、业务场景二、处理办法三、系统控制一、业务场景 生产订单正常没有按工序分配物料,系统会自动会把物料分配到第一道工序中 生产订单中的0010工序中对应的组件的栏位被标识,表示有物料分配到了0010的工序中,正常情况下0010的工序被分配…

软件测试基础面试题11问(带答案)

1、编写测试用例有哪些&#xff1f; 答&#xff1a;等价类、边界值、错误推测法、场景法&#xff0c;我个人常用的方法就是这些 2、Beta测试与Alpha测试的区别&#xff1f; 答&#xff1a;两者的主要区别是测试的场所不同。Alpha测试是指把用户请到开发方的场所来测试,beta测试…

Tomato靶场渗透测试

1.扫描靶机地址 可以使用nmap进行扫描 由于我这已经知道靶机地址 这里就不扫描了 2.打开网站 3.进行目录扫描 dirb http&#xff1a;//172.16.1.113 发现有一个antibot_image目录 4.访问这个目录 可以看到有一个info.php 5.查看页面源代码 可以发现可以进行get传参 6.…

C#文件的输入和输出

一个文件是一个存储在磁盘中带有指定名称和目录路径的数据集合.当打开文件进行读写时,它变成一个流.从根本上说,流是通过通信路径传递的字节序列.有两个主要的流:输入流和输出流.输入流用于从文件读取数据,输出流用于向文件写入数据. C#I/O类 System.IO命名空间有各种不同的类…

Unity Xcode方式接入sdk

入口 创建 GameAppController 类 继承 UnityAppController 并且在类的实现之前 需要 加 IMPL_APP_CONTROLLER_SUBCLASS(GameAppController)&#xff0c;表明这个是程序的入口。UnityAppController 实现了 UIApplicationDelegate。 可以简单看下 UIApplicationDelegate 的生命周…

拍卖新纪元:Spring Boot赋能在线拍卖解决方案

需求分析 1.1技术可行性&#xff1a;技术背景 在线拍卖系统是在Windows操作系统中进行开发运用的&#xff0c;而且目前PC机的各项性能已经可以胜任普通网站的web服务器。系统开发所使用的技术也都是自身所具有的&#xff0c;也是当下广泛应用的技术之一。 系统的开发环境和配置…

docker实战基础一 (Docker基础命令)

一、docker安装 # step 1: 安装必要的一些系统工具 yum install -y yum-utils device-mapper-persistent-data lvm2 # Step 2: 添加软件源信息 yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo # Step 3: 更新并安装 Doc…

Spring Boot:医疗排班系统开发的技术革新

2相关技术 2.1 MYSQL数据库 MySQL是一个真正的多用户、多线程SQL数据库服务器。 是基于SQL的客户/服务器模式的关系数据库管理系统&#xff0c;它的有点有有功能强大、使用简单、管理方便、安全可靠性高、运行速度快、多线程、跨平台性、完全网络化、稳定性等&#xff0c;非常…