Macro Texture

From FreeCAD Documentation
Revision as of 15:28, 18 April 2020 by Mario52 (talk | contribs) (Replaced content with "====Coordinate==== * '''Coordinate X:''' souřadnice X polohy objektu, implicitní: 0. * '''Coordinate Y:''' souřadnice Y polohy objektu, výchozí: 0. * '''Coordinate Z:...")

Macro Texture

Popis
Vytvoří obraz 3D z obrázku BMP 8 bitů (256 barev).

Version macro : 0.13
Date last modification : 2020-04-17
FreeCAD version : 0.18 and more
Download : ToolBar Icon, Macro Loft FCCreaLoft
Autor: Mario52
Autor
Mario52
Download
ToolBar Icon, Macro Loft FCCreaLoft
Odkazy
Verze
0.13
Datum poslední úpravy
2020-04-17
Verze FreeCAD
0.18 and more
Výchozí zástupce
None
Viz též
FCCreaLoft Macro Loft

Popis

Toto malé makro vám umožňuje velmi snadno vytvořit 3D projekt z bitmapového obrázku 256 úrovní šedé.

Doufám, že toto makro revoltuje způsob myšlení CAD a CNC jakéhokoli obrazu, když se může bez jakéhokoliv zásahu přeměnit na objekt 3D.

Všechno je možné bez ohledu na složitost obrazu !

Macro für die automatisierung des multi loft FCCreaLoft Macro Loft pro automatizaci multifunkčního loftu.

Temporary code for external macro link. Do not use this code. This code is used exclusively by Addon Manager. Link for optional manual installation: Macro


# This code is copied instead of the original macro code
# to guide the user to the online download page.
# Use it if the code of the macro is larger than 64 KB and cannot be included in the wiki
# or if the RAW code URL is somewhere else in the wiki.

from PySide import QtGui, QtCore

diag = QtGui.QMessageBox(QtGui.QMessageBox.Information,
    "Information",
    "This macro must be downloaded from this link\n"
    "\n"
    "https://gist.githubusercontent.com/mario52a/262317bc7d8555885b0e/raw/dc31d568180b5aa20887e20b5dc622fc860e1d33/Macro%2520FCTexture.FCMacro" + "\n"
    "\n"
    "Quit this window to access the download page")

diag.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
diag.setWindowModality(QtCore.Qt.ApplicationModal)
diag.exec_()

import webbrowser 
webbrowser.open("https://gist.githubusercontent.com/mario52a/262317bc7d8555885b0e/raw/dc31d568180b5aa20887e20b5dc622fc860e1d33/Macro%2520FCTexture.FCMacro")


Texture 004 Honda

Použijte

Toto makro potřebuje obrázek v 256 odstínech šedé (0-255), proto před použitím makra převeďte snímek na stupně šedi (černé a bílé) Lowe. Počet barev je automaticky detekován, je-li obrázek více než 256 barev, očekává se další funkce. Každá barva (úroveň šedé) se považuje za hlubokou, bílou (255) vysokou a černou (0) nejnižší (hlubokou).

Konfigurace se provádí před otevřením souboru, výchozí hodnoty jsou nastavení poskytnutá pro získání rozměrů projektu:

  • šířka obrázku v bodech v souřadnici X,
  • výška obrázku v bodech v souřadnici Y,
  • hloubka nebo tloušťka projektu unikla 10 mm (v surovém režimu, na 256 mm) v souřadnici Z.

Soubor s obrázkem se rozkládá jako skener x1 x2 x3 ... v krocích po 1 mm v aplikaci FreeCAD podobně jako hodnota y 1 mm najednou. Hodnota z je dána hodnotou barvy. Tyto hodnoty lze konfigurovat v makru.

Pozor: v závislosti na velikosti obrázku může být projekt velmi velký! pro záznam 100 pixelů široký a 100 pixelů na výšku dává 100 x 100 = 10000 bodů a každý bod odpovídá souřadnici, takže 10000 souřadnic XYZ tam je.

Rozhraní

Texture 002
Texture 002

Coordinate

  • Coordinate X: souřadnice X polohy objektu, implicitní: 0.
  • Coordinate Y: souřadnice Y polohy objektu, výchozí: 0.
  • Coordinate Z: souřadnice Z pozice objektu, výchozí: 0.

Stetching

  • Stetching X 0,00 mm  : narrowing or enlargement of the length of the object, default: 0.
  • Stetching Y 0,00 mm  : narrowing or enlargement of the height of the object, default: 0.
  • Stetching Z 0,00 mm  : narrowing or enlargement of the depth of the object, default: 0.

Inversion

  • Axis X : reverse coordinates X image.
  • Axis Y : reverse coordinates Y image.
  • Axis Z : reverse coordinates Z image.

Mode 8 Bits

The beginning of the operation value automatically adapts to the selected function: 0 if the setting is on black (Black) 255 or 20 if the setting is white (White).

  • Wire : build your line (vector) in the form of Wire.
  • Bspline : build your line (vector) in the form of Bspline.
  • Cloud : build the points vectors in the points cloud.
  • Point : creates a point at each pixel (vector). (the procedure can be long)
  • Nuance : If the shade option is checked the color of the point is represented as a picture.

Mode 32 Bits

  • Photo : the photo mode is automatically activated when a 32-bit image is detected. (the procedure can be long)
  • Plan : the plan allows you to import a 32-bit image and ignore the background of the plan. By default the map background is black to ignore colors are adjustable with the Capping command. If White is checked, the bottom has ignore will be white. (the procedure can be long)

File

  • .pcd : if is checked one file originalName.bmp.pcd is saved in the same directory of the file (pcd v0.7).
  • .asc : if is checked one file originalName.bmp.asc is saved in the same directory of the file. This file can be used as a cloud point (format: X Y Z).

Capping (10mm)

  • Slider : give the height of the form the height is displayed on title frame.
  • 0 height  : give the height of the form the height is displayed on title frame.
  • Raw mode 20 : to adjust the number of colors (depth). The default mode is 0-20 (which constitutes a filter and to obtain more details according to the complexity of the image) once the checked the mode is 0 to 255 (the entire range of colors).
  •  : this checkBox switch enabled the spinbox Contour.
  • 0/2 Contour  : this spinbox give the contour line do not use (ex: 0 for the base).
  • Capping White : the capping function can be made on the choice of colours, white (default) or black. The degrees of capping rule 20 to 0 (or 255 to 0) if the checkbox is set on W (unchecked) or 0 to 20 (or 0 to 255) if the checkbox is set on B (checked).
  • 20 Capping  : this spinbox give the degrees of capping.
  • File and lauch: otevře obrazový soubor a spustí konverzi.
  • Quit: ukončí funkci.

Skript

The icons .png and .svg


Macro_Texture.FCMacro

Stáhněte makro k obsahu Macro FCTexture.FCMacro

Příklad

Obrazy byly nakloněny ke zvýšení efektu 3D.









Odkazy

Diskuse o the forum abych získala své dojmy nebo mě kontaktovala.

Macro FCCreaLoft Macro Loft pro automatizaci multifunkčního loftu

apply hair cell texture

How to handle pdf import properly and feasibly?

Revize

  • ver 0.12 : 04/08/2019 add spinbox button for height
  • ver 0.11 :03/07/2019 adapt to Python 3
  • ver 0.10 : 28/12/2016 add save point in .pcd, .asc display a points cloud, height form, contour
  • ver 0.9 : 12/12/2016 adding save file .asc for cloud point
  • ver 0.8 : 16/03/2016 adding progressBar
  • ver 0.7 : 03/09/2014 Delete "translate" forgotten and bug fix discovered by the passage of PyQt to Pyside !
  • ver 0.6 : 26/08/2014 Delete all "_translate"
  • ver 0.5 : 25/08/2014 Delete "_translate (" MainWindow "," Stretching X ", None)" that prevented the display of tooltip with PySide (Windows Vista)
  • ver 0.4 : 08/08/2014 PyQt4 PySide
  • ver 0.3 : 28/03/2014 :comment out the line "# self.checkBox_5.setAccessibleName(_fromUtf8(""))"

that causes an error with the version FreeCAD : Version: 0.14.3343 (Git), Python version: 2.7.6, Qt version: 4.8.5